diff src/http/modules/ngx_http_addition_filter_module.c @ 2377:87b8c44906b5

*) refactor subrequest handling, now they run as separate posted requests *) now $upstream_addr, $upstream_status, $upstream_response_time can be used with log_subrequest
author Igor Sysoev <igor@sysoev.ru>
date Mon, 08 Dec 2008 14:23:20 +0000
parents 2cdefc40cabd
children c7d57b539248
line wrap: on
line diff
--- a/src/http/modules/ngx_http_addition_filter_module.c
+++ b/src/http/modules/ngx_http_addition_filter_module.c
@@ -151,10 +151,10 @@ ngx_http_addition_body_filter(ngx_http_r
         ctx->before_body_sent = 1;
 
         if (conf->before_body.len) {
-            rc = ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0);
-
-            if (rc == NGX_ERROR || rc == NGX_DONE) {
-                return rc;
+            if (ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0)
+                != NGX_OK)
+            {
+                return NGX_ERROR;
             }
         }
     }
@@ -180,10 +180,10 @@ ngx_http_addition_body_filter(ngx_http_r
         return rc;
     }
 
-    rc = ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0);
-
-    if (rc == NGX_ERROR || rc == NGX_DONE) {
-        return rc;
+    if (ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0)
+        != NGX_OK)
+    {
+        return NGX_ERROR;
     }
 
     ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module);