comparison src/http/modules/ngx_http_log_module.c @ 646:09a689c5e494 NGINX_1_0_13

nginx 1.0.13 *) Feature: the "return" and "error_page" directives can now be used to return 307 redirections. *) Bugfix: a segmentation fault might occur in a worker process if the "resolver" directive was used and there was no "error_log" directive specified at global level. Thanks to Roman Arutyunyan. *) Bugfix: memory leaks. Thanks to Lanshun Zhou. *) Bugfix: nginx might log incorrect error "upstream prematurely closed connection" instead of correct "upstream sent too big header" one. Thanks to Feibo Li. *) Bugfix: on ZFS filesystem disk cache size might be calculated incorrectly; the bug had appeared in 1.0.1. *) Bugfix: the number of internal redirects to named locations was not limited. *) Bugfix: temporary files might be not removed if the "proxy_store" directive was used with SSI includes. *) Bugfix: in some cases non-cacheable variables (such as the $args variable) returned old empty cached value. *) Bugfix: the "proxy_redirect" directives might be inherited incorrectly. *) Bugfix: nginx could not be built with the ngx_http_perl_module if the --with-openssl option was used. *) Bugfix: nginx could not be built by the icc 12.1 compiler.
author Igor Sysoev <http://sysoev.ru>
date Mon, 05 Mar 2012 00:00:00 +0400
parents ad25218fd14b
children
comparison
equal deleted inserted replaced
645:60344e6faa47 646:09a689c5e494
159 NULL, /* init main configuration */ 159 NULL, /* init main configuration */
160 160
161 NULL, /* create server configuration */ 161 NULL, /* create server configuration */
162 NULL, /* merge server configuration */ 162 NULL, /* merge server configuration */
163 163
164 ngx_http_log_create_loc_conf, /* create location configration */ 164 ngx_http_log_create_loc_conf, /* create location configuration */
165 ngx_http_log_merge_loc_conf /* merge location configration */ 165 ngx_http_log_merge_loc_conf /* merge location configuration */
166 }; 166 };
167 167
168 168
169 ngx_module_t ngx_http_log_module = { 169 ngx_module_t ngx_http_log_module = {
170 NGX_MODULE_V1, 170 NGX_MODULE_V1,
373 ngx_http_log_loc_conf_t *llcf; 373 ngx_http_log_loc_conf_t *llcf;
374 ngx_http_core_loc_conf_t *clcf; 374 ngx_http_core_loc_conf_t *clcf;
375 375
376 if (!r->root_tested) { 376 if (!r->root_tested) {
377 377
378 /* test root directory existance */ 378 /* test root directory existence */
379 379
380 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { 380 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
381 /* simulate successfull logging */ 381 /* simulate successful logging */
382 return len; 382 return len;
383 } 383 }
384 384
385 path.data[root] = '\0'; 385 path.data[root] = '\0';
386 386
397 397
398 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 398 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
399 != NGX_OK) 399 != NGX_OK)
400 { 400 {
401 if (of.err == 0) { 401 if (of.err == 0) {
402 /* simulate successfull logging */ 402 /* simulate successful logging */
403 return len; 403 return len;
404 } 404 }
405 405
406 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, 406 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
407 "testing \"%s\" existence failed", path.data); 407 "testing \"%s\" existence failed", path.data);
408 408
409 /* simulate successfull logging */ 409 /* simulate successful logging */
410 return len; 410 return len;
411 } 411 }
412 412
413 if (!of.is_dir) { 413 if (!of.is_dir) {
414 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, 414 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
415 "testing \"%s\" existence failed", path.data); 415 "testing \"%s\" existence failed", path.data);
416 416
417 /* simulate successfull logging */ 417 /* simulate successful logging */
418 return len; 418 return len;
419 } 419 }
420 } 420 }
421 421
422 if (ngx_http_script_run(r, &log, script->lengths->elts, 1, 422 if (ngx_http_script_run(r, &log, script->lengths->elts, 1,
423 script->values->elts) 423 script->values->elts)
424 == NULL) 424 == NULL)
425 { 425 {
426 /* simulate successfull logging */ 426 /* simulate successful logging */
427 return len; 427 return len;
428 } 428 }
429 429
430 log.data[log.len - 1] = '\0'; 430 log.data[log.len - 1] = '\0';
431 *name = log.data; 431 *name = log.data;
445 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) 445 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool)
446 != NGX_OK) 446 != NGX_OK)
447 { 447 {
448 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, 448 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
449 "%s \"%s\" failed", of.failed, log.data); 449 "%s \"%s\" failed", of.failed, log.data);
450 /* simulate successfull logging */ 450 /* simulate successful logging */
451 return len; 451 return len;
452 } 452 }
453 453
454 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 454 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
455 "http log #%d", of.fd); 455 "http log #%d", of.fd);