diff src/http/ngx_http_log_handler.c @ 4:4b2dafa26fe2 NGINX_0_1_2

nginx 0.1.2 *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; bug appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; bug appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
author Igor Sysoev <http://sysoev.ru>
date Thu, 21 Oct 2004 00:00:00 +0400
parents f0b350454894
children 46833bd150cb
line wrap: on
line diff
--- a/src/http/ngx_http_log_handler.c
+++ b/src/http/ngx_http_log_handler.c
@@ -210,9 +210,13 @@ static u_char *ngx_http_log_addr(ngx_htt
 static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
                                      uintptr_t data)
 {
+    return ngx_sprintf(buf, "%ui", r->connection->number);
+
+#if 0
     return buf + ngx_snprintf((char *) buf, NGX_INT_T_LEN + 1,
                               "%" NGX_UINT_T_FMT,
                               r->connection->number);
+#endif
 }
 
 
@@ -244,8 +248,12 @@ static u_char *ngx_http_log_msec(ngx_htt
 
     ngx_gettimeofday(&tv);
 
+    return ngx_sprintf(buf, "%l.%03l", tv.tv_sec, tv.tv_usec / 1000);
+
+#if 0
     return buf + ngx_snprintf((char *) buf, TIME_T_LEN + 5, "%ld.%03ld",
                               tv.tv_sec, tv.tv_usec / 1000);
+#endif
 }
 
 
@@ -264,24 +272,36 @@ static u_char *ngx_http_log_request(ngx_
 static u_char *ngx_http_log_status(ngx_http_request_t *r, u_char *buf,
                                    uintptr_t data)
 {
+    return ngx_sprintf(buf, "%ui",
+                       r->err_status ? r->err_status : r->headers_out.status);
+
+#if 0
     return buf + ngx_snprintf((char *) buf, 4, "%" NGX_UINT_T_FMT,
                         r->err_status ? r->err_status : r->headers_out.status);
+#endif
 }
 
 
 static u_char *ngx_http_log_length(ngx_http_request_t *r, u_char *buf,
                                    uintptr_t data)
 {
+    return ngx_sprintf(buf, "%O", r->connection->sent);
+
+#if 0
     return buf + ngx_snprintf((char *) buf, NGX_OFF_T_LEN + 1, OFF_T_FMT,
                               r->connection->sent);
+#endif
 }
 
 
 static u_char *ngx_http_log_apache_length(ngx_http_request_t *r, u_char *buf,
                                           uintptr_t data)
 {
+    return ngx_sprintf(buf, "%O", r->connection->sent - r->header_size);
+#if 0
     return buf + ngx_snprintf((char *) buf, NGX_OFF_T_LEN + 1, OFF_T_FMT,
                               r->connection->sent - r->header_size);
+#endif
 }
 
 
@@ -467,8 +487,7 @@ static u_char *ngx_http_log_header_out(n
                     return (u_char *)
                                    sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1;
                 }
-                return buf + ngx_http_time(buf,
-                                           r->headers_out.last_modified_time);
+                return ngx_http_time(buf, r->headers_out.last_modified_time);
             }
 
             if (buf) {