diff src/http/ngx_http_log_handler.c @ 10:46833bd150cb NGINX_0_1_5

nginx 0.1.5 *) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
author Igor Sysoev <http://sysoev.ru>
date Thu, 11 Nov 2004 00:00:00 +0300
parents 4b2dafa26fe2
children 8b6db3bda591
line wrap: on
line diff
--- a/src/http/ngx_http_log_handler.c
+++ b/src/http/ngx_http_log_handler.c
@@ -133,7 +133,7 @@ ngx_int_t ngx_http_log_handler(ngx_http_
     ngx_http_log_t           *log;
     ngx_http_log_op_t        *op;
     ngx_http_log_loc_conf_t  *lcf;
-#if (WIN32)
+#if (NGX_WIN32)
     u_long                    written;
 #endif
 
@@ -160,7 +160,7 @@ ngx_int_t ngx_http_log_handler(ngx_http_
             }
         }
 
-#if (WIN32)
+#if (NGX_WIN32)
         len += 2;
 #else
         len++;
@@ -186,7 +186,7 @@ ngx_int_t ngx_http_log_handler(ngx_http_
             }
         }
 
-#if (WIN32)
+#if (NGX_WIN32)
         *p++ = CR; *p++ = LF;
         WriteFile(log[l].file->fd, line, p - line, &written, NULL);
 #else
@@ -211,12 +211,6 @@ static u_char *ngx_http_log_connection(n
                                      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
 }
 
 
@@ -249,11 +243,6 @@ 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
 }
 
 
@@ -274,11 +263,6 @@ static u_char *ngx_http_log_status(ngx_h
 {
     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
 }
 
 
@@ -286,11 +270,6 @@ static u_char *ngx_http_log_length(ngx_h
                                    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
 }
 
 
@@ -298,10 +277,6 @@ static u_char *ngx_http_log_apache_lengt
                                           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
 }
 
 
@@ -470,9 +445,7 @@ static u_char *ngx_http_log_header_out(n
                 if (buf == NULL) {
                     return (u_char *) NGX_OFF_T_LEN;
                 }
-                return buf + ngx_snprintf((char *) buf,
-                                          NGX_OFF_T_LEN + 2, OFF_T_FMT,
-                                          r->headers_out.content_length_n);
+                return ngx_sprintf(buf, "%O", r->headers_out.content_length_n);
             }
 
             if (data == offsetof(ngx_http_headers_out_t, last_modified)) {