diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2017-10-16 13:13:25 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2017-10-16 13:13:25 +0300 |
commit | fdbf551602c3cca974d722ab36caeb191a19746c (patch) | |
tree | c1d2767608ecd5ddd993a953055f1e1bc8b12578 | |
parent | 77c7875a7b18ccca1ebae1757b9246c9b3b55bf9 (diff) | |
download | nginx-fdbf551602c3cca974d722ab36caeb191a19746c.tar.gz nginx-fdbf551602c3cca974d722ab36caeb191a19746c.zip |
Postpone filter: handled ngx_http_postpone_filter_add() failures.
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.
-rw-r--r-- | src/http/ngx_http_postpone_filter_module.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/http/ngx_http_postpone_filter_module.c b/src/http/ngx_http_postpone_filter_module.c index e893b8364..55f2698c5 100644 --- a/src/http/ngx_http_postpone_filter_module.c +++ b/src/http/ngx_http_postpone_filter_module.c @@ -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 { |