diff src/http/ngx_http_special_response.c @ 2821:26e06e009ced

allow to pass image filter errors via the same location where the filter is set
author Igor Sysoev <igor@sysoev.ru>
date Fri, 08 May 2009 14:52:50 +0000
parents 43fe53832da7
children 5364c3419a62
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -446,15 +446,25 @@ ngx_http_special_response_handler(ngx_ht
 
 
 ngx_int_t
-ngx_http_filter_finalize_request(ngx_http_request_t *r, ngx_int_t error)
+ngx_http_filter_finalize_request(ngx_http_request_t *r, ngx_module_t *m,
+    ngx_int_t error)
 {
-    ngx_int_t  rc;
+    void       *ctx;
+    ngx_int_t   rc;
 
     ngx_http_clean_header(r);
 
+    if (m) {
+        ctx = r->ctx[m->ctx_index];
+    }
+
     /* clear the modules contexts */
     ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
 
+    if (m) {
+        r->ctx[m->ctx_index] = ctx;
+    }
+
     r->filter_finalize = 1;
 
     rc = ngx_http_special_response_handler(r, error);