comparison src/http/modules/ngx_http_log_module.c @ 664:f5b859b2f097 NGINX_1_1_16

nginx 1.1.16 *) Change: the simultaneous subrequest limit has been raised to 200. *) Feature: the "from" parameter of the "disable_symlinks" directive. *) Feature: the "return" and "error_page" directives can 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: a segmentation fault might occur in a worker process if the "proxy_http_version 1.1" or "fastcgi_keep_conn on" directives were used. *) Bugfix: memory leaks. Thanks to Lanshun Zhou. *) Bugfix: in the "disable_symlinks" directive. *) Bugfix: on ZFS filesystem disk cache size might be calculated incorrectly; the bug had appeared in 1.0.1. *) Bugfix: nginx could not be built by the icc 12.1 compiler. *) Bugfix: nginx could not be built by gcc on Solaris; the bug had appeared in 1.1.15.
author Igor Sysoev <http://sysoev.ru>
date Wed, 29 Feb 2012 00:00:00 +0400
parents e5fa0a4a7d27
children 9fbf3ad94cbf
comparison
equal deleted inserted replaced
663:dd668cf20818 664:f5b859b2f097
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,
375 375
376 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); 376 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
377 377
378 if (!r->root_tested) { 378 if (!r->root_tested) {
379 379
380 /* test root directory existance */ 380 /* test root directory existence */
381 381
382 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { 382 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
383 /* simulate successfull logging */ 383 /* simulate successful logging */
384 return len; 384 return len;
385 } 385 }
386 386
387 path.data[root] = '\0'; 387 path.data[root] = '\0';
388 388
392 of.min_uses = clcf->open_file_cache_min_uses; 392 of.min_uses = clcf->open_file_cache_min_uses;
393 of.test_dir = 1; 393 of.test_dir = 1;
394 of.test_only = 1; 394 of.test_only = 1;
395 of.errors = clcf->open_file_cache_errors; 395 of.errors = clcf->open_file_cache_errors;
396 of.events = clcf->open_file_cache_events; 396 of.events = clcf->open_file_cache_events;
397 #if (NGX_HAVE_OPENAT) 397
398 of.disable_symlinks = clcf->disable_symlinks; 398 if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
399 #endif 399 /* simulate successful logging */
400 return len;
401 }
400 402
401 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 403 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
402 != NGX_OK) 404 != NGX_OK)
403 { 405 {
404 if (of.err == 0) { 406 if (of.err == 0) {
405 /* simulate successfull logging */ 407 /* simulate successful logging */
406 return len; 408 return len;
407 } 409 }
408 410
409 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, 411 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
410 "testing \"%s\" existence failed", path.data); 412 "testing \"%s\" existence failed", path.data);
411 413
412 /* simulate successfull logging */ 414 /* simulate successful logging */
413 return len; 415 return len;
414 } 416 }
415 417
416 if (!of.is_dir) { 418 if (!of.is_dir) {
417 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, 419 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
418 "testing \"%s\" existence failed", path.data); 420 "testing \"%s\" existence failed", path.data);
419 421
420 /* simulate successfull logging */ 422 /* simulate successful logging */
421 return len; 423 return len;
422 } 424 }
423 } 425 }
424 426
425 if (ngx_http_script_run(r, &log, script->lengths->elts, 1, 427 if (ngx_http_script_run(r, &log, script->lengths->elts, 1,
426 script->values->elts) 428 script->values->elts)
427 == NULL) 429 == NULL)
428 { 430 {
429 /* simulate successfull logging */ 431 /* simulate successful logging */
430 return len; 432 return len;
431 } 433 }
432 434
433 log.data[log.len - 1] = '\0'; 435 log.data[log.len - 1] = '\0';
434 *name = log.data; 436 *name = log.data;
442 444
443 of.log = 1; 445 of.log = 1;
444 of.valid = llcf->open_file_cache_valid; 446 of.valid = llcf->open_file_cache_valid;
445 of.min_uses = llcf->open_file_cache_min_uses; 447 of.min_uses = llcf->open_file_cache_min_uses;
446 of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; 448 of.directio = NGX_OPEN_FILE_DIRECTIO_OFF;
447 #if (NGX_HAVE_OPENAT) 449
448 of.disable_symlinks = clcf->disable_symlinks; 450 if (ngx_http_set_disable_symlinks(r, clcf, &log, &of) != NGX_OK) {
449 #endif 451 /* simulate successful logging */
452 return len;
453 }
450 454
451 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) 455 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool)
452 != NGX_OK) 456 != NGX_OK)
453 { 457 {
454 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, 458 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
455 "%s \"%s\" failed", of.failed, log.data); 459 "%s \"%s\" failed", of.failed, log.data);
456 /* simulate successfull logging */ 460 /* simulate successful logging */
457 return len; 461 return len;
458 } 462 }
459 463
460 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 464 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
461 "http log #%d", of.fd); 465 "http log #%d", of.fd);