diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2008-07-07 09:26:13 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2008-07-07 09:26:13 +0000 |
| commit | edf1c8c1b8a83a6592714516499a18adc830eeae (patch) | |
| tree | 01983bdab8428b3647f52d14fa098140070a7389 /src/http/modules/ngx_http_log_module.c | |
| parent | 4f677fd20377230cf959cddb39ceb4d566ce4866 (diff) | |
| download | nginx-edf1c8c1b8a83a6592714516499a18adc830eeae.tar.gz nginx-edf1c8c1b8a83a6592714516499a18adc830eeae.tar.bz2 | |
always test root existence for access_log with variables
Diffstat (limited to 'src/http/modules/ngx_http_log_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_log_module.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index ce7559753..5b8adc595 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -366,7 +366,7 @@ ngx_http_log_script_write(ngx_http_request_t *r, ngx_http_log_script_t *script, ngx_http_log_loc_conf_t *llcf; ngx_http_core_loc_conf_t *clcf; - if (r->err_status == NGX_HTTP_NOT_FOUND) { + if (!r->root_tested) { /* test root directory existance */ @@ -387,10 +387,25 @@ ngx_http_log_script_write(ngx_http_request_t *r, ngx_http_log_script_t *script, of.events = clcf->open_file_cache_events; if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool) - != NGX_OK - || !of.is_dir) + != NGX_OK) { - /* no root directory: simulate successfull logging */ + if (of.err == 0) { + /* simulate successfull logging */ + return len; + } + + ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err, + "testing \"%s\" existence failed", path.data); + + /* simulate successfull logging */ + return len; + } + + if (!of.is_dir) { + ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR, + "testing \"%s\" existence failed", path.data); + + /* simulate successfull logging */ return len; } } |
