Mercurial > hg > nginx
comparison src/http/modules/ngx_http_log_module.c @ 2087:c8039b26a949
always test root existence for access_log with variables
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 07 Jul 2008 09:26:13 +0000 |
parents | a24c7009de0b |
children | f62751dab60d |
comparison
equal
deleted
inserted
replaced
2086:22d36702c654 | 2087:c8039b26a949 |
---|---|
364 ngx_str_t log, path; | 364 ngx_str_t log, path; |
365 ngx_open_file_info_t of; | 365 ngx_open_file_info_t of; |
366 ngx_http_log_loc_conf_t *llcf; | 366 ngx_http_log_loc_conf_t *llcf; |
367 ngx_http_core_loc_conf_t *clcf; | 367 ngx_http_core_loc_conf_t *clcf; |
368 | 368 |
369 if (r->err_status == NGX_HTTP_NOT_FOUND) { | 369 if (!r->root_tested) { |
370 | 370 |
371 /* test root directory existance */ | 371 /* test root directory existance */ |
372 | 372 |
373 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { | 373 if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) { |
374 /* simulate successfull logging */ | 374 /* simulate successfull logging */ |
385 of.min_uses = clcf->open_file_cache_min_uses; | 385 of.min_uses = clcf->open_file_cache_min_uses; |
386 of.errors = clcf->open_file_cache_errors; | 386 of.errors = clcf->open_file_cache_errors; |
387 of.events = clcf->open_file_cache_events; | 387 of.events = clcf->open_file_cache_events; |
388 | 388 |
389 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) | 389 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) |
390 != NGX_OK | 390 != NGX_OK) |
391 || !of.is_dir) | |
392 { | 391 { |
393 /* no root directory: simulate successfull logging */ | 392 if (of.err == 0) { |
393 /* simulate successfull logging */ | |
394 return len; | |
395 } | |
396 | |
397 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, | |
398 "testing \"%s\" existence failed", path.data); | |
399 | |
400 /* simulate successfull logging */ | |
401 return len; | |
402 } | |
403 | |
404 if (!of.is_dir) { | |
405 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, | |
406 "testing \"%s\" existence failed", path.data); | |
407 | |
408 /* simulate successfull logging */ | |
394 return len; | 409 return len; |
395 } | 410 } |
396 } | 411 } |
397 | 412 |
398 if (ngx_http_script_run(r, &log, script->lengths->elts, 1, | 413 if (ngx_http_script_run(r, &log, script->lengths->elts, 1, |