]> git.kaiwu.me - nginx.git/commitdiff
Postpone filter: handled ngx_http_postpone_filter_add() failures.
authorSergey Kandaurov <pluknet@nginx.com>
Mon, 16 Oct 2017 10:13:25 +0000 (13:13 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Mon, 16 Oct 2017 10:13:25 +0000 (13:13 +0300)
In particular, if ngx_http_postpone_filter_add() fails in ngx_chain_add_copy(),
the output chain of the postponed request was left in an invalid state.

src/http/ngx_http_postpone_filter_module.c

index e893b8364886e2418dbc4d59beefb7e7ec19f600..55f2698c5e69a3c72cca0f4636993b002aeff123 100644 (file)
@@ -63,7 +63,10 @@ ngx_http_postpone_filter(ngx_http_request_t *r, ngx_chain_t *in)
     if (r != c->data) {
 
         if (in) {
-            ngx_http_postpone_filter_add(r, in);
+            if (ngx_http_postpone_filter_add(r, in) != NGX_OK) {
+                return NGX_ERROR;
+            }
+
             return NGX_OK;
         }
 
@@ -86,7 +89,9 @@ ngx_http_postpone_filter(ngx_http_request_t *r, ngx_chain_t *in)
     }
 
     if (in) {
-        ngx_http_postpone_filter_add(r, in);
+        if (ngx_http_postpone_filter_add(r, in) != NGX_OK) {
+            return NGX_ERROR;
+        }
     }
 
     do {