ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Сбор статистики о файле



В общем ошибка и у меня и в post_action. Прилагаемый патч нормализует
поведение cleanup-процедур, при использовнии post_action.
Index: ngx_http_request.c
===================================================================
RCS file: 
u:\cvsroot/uploads/components/nginx-0.3.41/src/http/ngx_http_request.c,v
retrieving revision 1.1
diff -u -r1.1 ngx_http_request.c
--- ngx_http_request.c  21 Apr 2006 14:58:04 -0000      1.1
+++ ngx_http_request.c  21 Apr 2006 21:11:14 -0000
@@ -37,6 +37,7 @@
 static void ngx_http_set_lingering_close(ngx_http_request_t *r);
 static void ngx_http_lingering_close_handler(ngx_event_t *ev);
 static ngx_int_t ngx_http_post_action(ngx_http_request_t *r);
+static void ngx_http_cleanup_request(ngx_http_request_t *r);
 static void ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error);
 static void ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error);
 static void ngx_http_close_connection(ngx_connection_t *c);
@@ -2139,6 +2140,7 @@
         return NGX_DECLINED;
     }
 
+    ngx_http_cleanup_request(r);
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                    "post action: \"%V\"", &clcf->post_action);
 
@@ -2151,7 +2153,15 @@
     return NGX_OK;
 }
 
-
+static void ngx_http_cleanup_request(ngx_http_request_t *r)
+{
+    ngx_http_cleanup_t         *cln;
+    for (cln = r->cleanup; cln; cln = cln->next) {
+        if (cln->handler) {
+            cln->handler(cln->data);
+        }
+    }
+}
 static void
 ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
 {
@@ -2170,7 +2180,6 @@
     ngx_log_t                  *log;
     ngx_uint_t                  i, n;
     struct linger               linger;
-    ngx_http_cleanup_t         *cln;
     ngx_http_log_ctx_t         *ctx;
     ngx_http_handler_pt        *log_handler;
     ngx_http_core_loc_conf_t   *clcf;
@@ -2185,11 +2194,7 @@
         return;
     }
 
-    for (cln = r->cleanup; cln; cln = cln->next) {
-        if (cln->handler) {
-            cln->handler(cln->data);
-        }
-    }
+    ngx_http_cleanup_request(r);
 
 #if (NGX_STAT_STUB)
 


 




Copyright © Lexa Software, 1996-2009.