diff src/http/modules/ngx_http_log_module.c @ 388:6de24473fa70 NGINX_0_7_6

nginx 0.7.6 *) Bugfix: now if variables are used in the "access_log" directive a request root existence is always tested. *) Bugfix: the ngx_http_flv_module did not support several values in a query string.
author Igor Sysoev <http://sysoev.ru>
date Mon, 07 Jul 2008 00:00:00 +0400
parents 1172e6d6f40f
children 79c5df00501e
line wrap: on
line diff
--- 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_reque
     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_reque
         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;
         }
     }