comparison 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
comparison
equal deleted inserted replaced
3:8beaf7b3241f 4:4b2dafa26fe2
208 208
209 209
210 static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf, 210 static u_char *ngx_http_log_connection(ngx_http_request_t *r, u_char *buf,
211 uintptr_t data) 211 uintptr_t data)
212 { 212 {
213 return ngx_sprintf(buf, "%ui", r->connection->number);
214
215 #if 0
213 return buf + ngx_snprintf((char *) buf, NGX_INT_T_LEN + 1, 216 return buf + ngx_snprintf((char *) buf, NGX_INT_T_LEN + 1,
214 "%" NGX_UINT_T_FMT, 217 "%" NGX_UINT_T_FMT,
215 r->connection->number); 218 r->connection->number);
219 #endif
216 } 220 }
217 221
218 222
219 static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf, 223 static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf,
220 uintptr_t data) 224 uintptr_t data)
242 { 246 {
243 struct timeval tv; 247 struct timeval tv;
244 248
245 ngx_gettimeofday(&tv); 249 ngx_gettimeofday(&tv);
246 250
251 return ngx_sprintf(buf, "%l.%03l", tv.tv_sec, tv.tv_usec / 1000);
252
253 #if 0
247 return buf + ngx_snprintf((char *) buf, TIME_T_LEN + 5, "%ld.%03ld", 254 return buf + ngx_snprintf((char *) buf, TIME_T_LEN + 5, "%ld.%03ld",
248 tv.tv_sec, tv.tv_usec / 1000); 255 tv.tv_sec, tv.tv_usec / 1000);
256 #endif
249 } 257 }
250 258
251 259
252 static u_char *ngx_http_log_request(ngx_http_request_t *r, u_char *buf, 260 static u_char *ngx_http_log_request(ngx_http_request_t *r, u_char *buf,
253 uintptr_t data) 261 uintptr_t data)
262 270
263 271
264 static u_char *ngx_http_log_status(ngx_http_request_t *r, u_char *buf, 272 static u_char *ngx_http_log_status(ngx_http_request_t *r, u_char *buf,
265 uintptr_t data) 273 uintptr_t data)
266 { 274 {
275 return ngx_sprintf(buf, "%ui",
276 r->err_status ? r->err_status : r->headers_out.status);
277
278 #if 0
267 return buf + ngx_snprintf((char *) buf, 4, "%" NGX_UINT_T_FMT, 279 return buf + ngx_snprintf((char *) buf, 4, "%" NGX_UINT_T_FMT,
268 r->err_status ? r->err_status : r->headers_out.status); 280 r->err_status ? r->err_status : r->headers_out.status);
281 #endif
269 } 282 }
270 283
271 284
272 static u_char *ngx_http_log_length(ngx_http_request_t *r, u_char *buf, 285 static u_char *ngx_http_log_length(ngx_http_request_t *r, u_char *buf,
273 uintptr_t data) 286 uintptr_t data)
274 { 287 {
288 return ngx_sprintf(buf, "%O", r->connection->sent);
289
290 #if 0
275 return buf + ngx_snprintf((char *) buf, NGX_OFF_T_LEN + 1, OFF_T_FMT, 291 return buf + ngx_snprintf((char *) buf, NGX_OFF_T_LEN + 1, OFF_T_FMT,
276 r->connection->sent); 292 r->connection->sent);
293 #endif
277 } 294 }
278 295
279 296
280 static u_char *ngx_http_log_apache_length(ngx_http_request_t *r, u_char *buf, 297 static u_char *ngx_http_log_apache_length(ngx_http_request_t *r, u_char *buf,
281 uintptr_t data) 298 uintptr_t data)
282 { 299 {
300 return ngx_sprintf(buf, "%O", r->connection->sent - r->header_size);
301 #if 0
283 return buf + ngx_snprintf((char *) buf, NGX_OFF_T_LEN + 1, OFF_T_FMT, 302 return buf + ngx_snprintf((char *) buf, NGX_OFF_T_LEN + 1, OFF_T_FMT,
284 r->connection->sent - r->header_size); 303 r->connection->sent - r->header_size);
304 #endif
285 } 305 }
286 306
287 307
288 static u_char *ngx_http_log_header_in(ngx_http_request_t *r, u_char *buf, 308 static u_char *ngx_http_log_header_in(ngx_http_request_t *r, u_char *buf,
289 uintptr_t data) 309 uintptr_t data)
465 485
466 if (buf == NULL) { 486 if (buf == NULL) {
467 return (u_char *) 487 return (u_char *)
468 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1; 488 sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1;
469 } 489 }
470 return buf + ngx_http_time(buf, 490 return ngx_http_time(buf, r->headers_out.last_modified_time);
471 r->headers_out.last_modified_time);
472 } 491 }
473 492
474 if (buf) { 493 if (buf) {
475 *buf = '-'; 494 *buf = '-';
476 } 495 }