Klaus Demo nginx / edf1c8c
always test root existence for access_log with variables Igor Sysoev 13 years ago
5 changed file(s) with 26 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
158158 return NGX_DECLINED;
159159 }
160160
161 r->root_tested = 1;
162
161163 start = 0;
162164 len = of.size;
163165 i = 1;
174174
175175 #endif
176176
177 r->root_tested = 1;
178
177179 rc = ngx_http_discard_request_body(r);
178180
179181 if (rc != NGX_OK) {
365365 ngx_http_log_loc_conf_t *llcf;
366366 ngx_http_core_loc_conf_t *clcf;
367367
368 if (r->err_status == NGX_HTTP_NOT_FOUND) {
368 if (!r->root_tested) {
369369
370370 /* test root directory existance */
371371
386386 of.events = clcf->open_file_cache_events;
387387
388388 if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
389 != NGX_OK
390 || !of.is_dir)
389 != NGX_OK)
391390 {
392 /* no root directory: simulate successfull logging */
391 if (of.err == 0) {
392 /* simulate successfull logging */
393 return len;
394 }
395
396 ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
397 "testing \"%s\" existence failed", path.data);
398
399 /* simulate successfull logging */
400 return len;
401 }
402
403 if (!of.is_dir) {
404 ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
405 "testing \"%s\" existence failed", path.data);
406
407 /* simulate successfull logging */
393408 return len;
394409 }
395410 }
139139 return rc;
140140 }
141141
142 r->root_tested = 1;
143
142144 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
143145
144146 if (of.is_dir) {
468468 unsigned request_output:1;
469469 unsigned header_sent:1;
470470 unsigned expect_tested:1;
471 unsigned root_tested:1;
471472 unsigned done:1;
472473 unsigned utf8:1;
473474