updated the gzip_flush_bug patch according to the feedback from Maxim Dounin.

pull/35/head
Yichun Zhang (agentzh) 11 years ago
parent 1df484be52
commit 8bc4bf391a

@ -1,19 +1,28 @@
--- nginx-1.4.3/src/http/modules/ngx_http_gzip_filter_module.c 2013-10-08 05:07:14.000000000 -0700 --- nginx-1.4.3/src/http/modules/ngx_http_gzip_filter_module.c 2013-10-08 05:07:14.000000000 -0700
+++ nginx-1.4.3-patched/src/http/modules/ngx_http_gzip_filter_module.c 2013-10-25 17:00:00.712697908 -0700 +++ nginx-1.4.3-patched/src/http/modules/ngx_http_gzip_filter_module.c 2013-10-26 17:14:22.132109569 -0700
@@ -433,7 +433,15 @@ ngx_http_gzip_body_filter(ngx_http_reque @@ -370,11 +370,12 @@ ngx_http_gzip_body_filter(ngx_http_reque
if (ctx->out == NULL) { }
ngx_http_gzip_filter_free_copy_buf(r, ctx); }
- return ctx->busy ? NGX_AGAIN : NGX_OK; - if (ctx->nomem) {
+ if (ctx->busy) { + if (ctx->nomem || in == NULL) {
+ if (in == NULL) {
+ return ngx_http_next_body_filter(r, NULL); /* flush busy buffers */
+ }
- if (ngx_http_next_body_filter(r, NULL) == NGX_ERROR) {
+ rc = ngx_http_next_body_filter(r, NULL);
+ if (rc == NGX_ERROR) {
goto failed;
}
@@ -383,6 +384,10 @@ ngx_http_gzip_body_filter(ngx_http_reque
ngx_chain_update_chains(r->pool, &ctx->free, &ctx->busy, &cl,
(ngx_buf_tag_t) &ngx_http_gzip_filter_module);
ctx->nomem = 0;
+ +
+ return NGX_AGAIN; + if (in == NULL) {
+ return rc;
+ } + }
+
+ return NGX_OK;
} }
if (!ctx->gzheader) { for ( ;; ) {

Loading…
Cancel
Save