comparison src/http/modules/ngx_http_log_module.c @ 662:e5fa0a4a7d27 NGINX_1_1_15

nginx 1.1.15 *) Feature: the "disable_symlinks" directive. *) Feature: the "proxy_cookie_domain" and "proxy_cookie_path" directives. *) Bugfix: nginx might log incorrect error "upstream prematurely closed connection" instead of correct "upstream sent too big header" one. Thanks to Feibo Li. *) Bugfix: nginx could not be built with the ngx_http_perl_module if the --with-openssl option was used. *) Bugfix: internal redirects to named locations were not limited. *) Bugfix: calling $r->flush() multiple times might cause errors in the ngx_http_gzip_filter_module. *) Bugfix: temporary files might be not removed if the "proxy_store" directive were used with SSI includes. *) Bugfix: in some cases non-cacheable variables (such as the $args variable) returned old empty cached value. *) Bugfix: a segmentation fault might occur in a worker process if too many SSI subrequests were issued simultaneously; the bug had appeared in 0.7.25.
author Igor Sysoev <http://sysoev.ru>
date Wed, 15 Feb 2012 00:00:00 +0400
parents d0f7a625f27c
children f5b859b2f097
comparison
equal deleted inserted replaced
661:b49c1751031c 662:e5fa0a4a7d27
371 ngx_str_t log, path; 371 ngx_str_t log, path;
372 ngx_open_file_info_t of; 372 ngx_open_file_info_t of;
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 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
377
376 if (!r->root_tested) { 378 if (!r->root_tested) {
377 379
378 /* test root directory existance */ 380 /* test root directory existance */
379 381
380 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) {
381 /* simulate successfull logging */ 383 /* simulate successfull logging */
382 return len; 384 return len;
383 } 385 }
384 386
385 path.data[root] = '\0'; 387 path.data[root] = '\0';
386
387 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
388 388
389 ngx_memzero(&of, sizeof(ngx_open_file_info_t)); 389 ngx_memzero(&of, sizeof(ngx_open_file_info_t));
390 390
391 of.valid = clcf->open_file_cache_valid; 391 of.valid = clcf->open_file_cache_valid;
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)
398 of.disable_symlinks = clcf->disable_symlinks;
399 #endif
397 400
398 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) 401 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
399 != NGX_OK) 402 != NGX_OK)
400 { 403 {
401 if (of.err == 0) { 404 if (of.err == 0) {
439 442
440 of.log = 1; 443 of.log = 1;
441 of.valid = llcf->open_file_cache_valid; 444 of.valid = llcf->open_file_cache_valid;
442 of.min_uses = llcf->open_file_cache_min_uses; 445 of.min_uses = llcf->open_file_cache_min_uses;
443 of.directio = NGX_OPEN_FILE_DIRECTIO_OFF; 446 of.directio = NGX_OPEN_FILE_DIRECTIO_OFF;
447 #if (NGX_HAVE_OPENAT)
448 of.disable_symlinks = clcf->disable_symlinks;
449 #endif
444 450
445 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool) 451 if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool)
446 != NGX_OK) 452 != NGX_OK)
447 { 453 {
448 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno, 454 ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
1247 1253
1248 s.len = value[i].len - 9; 1254 s.len = value[i].len - 9;
1249 s.data = value[i].data + 9; 1255 s.data = value[i].data + 9;
1250 1256
1251 inactive = ngx_parse_time(&s, 1); 1257 inactive = ngx_parse_time(&s, 1);
1252 if (inactive < 0) { 1258 if (inactive == (time_t) NGX_ERROR) {
1253 goto failed; 1259 goto failed;
1254 } 1260 }
1255 1261
1256 continue; 1262 continue;
1257 } 1263 }
1270 1276
1271 s.len = value[i].len - 6; 1277 s.len = value[i].len - 6;
1272 s.data = value[i].data + 6; 1278 s.data = value[i].data + 6;
1273 1279
1274 valid = ngx_parse_time(&s, 1); 1280 valid = ngx_parse_time(&s, 1);
1275 if (valid < 0) { 1281 if (valid == (time_t) NGX_ERROR) {
1276 goto failed; 1282 goto failed;
1277 } 1283 }
1278 1284
1279 continue; 1285 continue;
1280 } 1286 }