diff src/http/ngx_http_write_filter_module.c @ 686:2e8a942c8872 NGINX_1_3_6

nginx 1.3.6 *) Feature: the ngx_http_gunzip_filter_module. *) Feature: the "memcached_gzip_flag" directive. *) Feature: the "always" parameter of the "gzip_static" directive. *) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14. Thanks to Charles Chen. *) Bugfix: nginx could not be built by gcc 4.7 with -O2 optimization if the --with-ipv6 option was used.
author Igor Sysoev <http://sysoev.ru>
date Wed, 12 Sep 2012 00:00:00 +0400
parents d0f7a625f27c
children 88a1b4797f2e
line wrap: on
line diff
--- a/src/http/ngx_http_write_filter_module.c
+++ b/src/http/ngx_http_write_filter_module.c
@@ -185,18 +185,14 @@ ngx_http_write_filter(ngx_http_request_t
     }
 
     if (size == 0 && !(c->buffered & NGX_LOWLEVEL_BUFFERED)) {
-        if (last) {
-            r->out = NULL;
-            c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
+        if (last || flush) {
+            for (cl = r->out; cl; /* void */) {
+                ln = cl;
+                cl = cl->next;
+                ngx_free_chain(r->pool, ln);
+            }
 
-            return NGX_OK;
-        }
-
-        if (flush) {
-            do {
-                r->out = r->out->next;
-            } while (r->out);
-
+            r->out = NULL;
             c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
 
             return NGX_OK;