diff src/http/ngx_http_write_filter.c @ 32:da8c190bdaba NGINX_0_1_16

nginx 0.1.16 *) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; bug appeared in 0.1.14.
author Igor Sysoev <http://sysoev.ru>
date Tue, 25 Jan 2005 00:00:00 +0300
parents 7ca9bdc82b3f
children 2879cd3a40cb
line wrap: on
line diff
--- a/src/http/ngx_http_write_filter.c
+++ b/src/http/ngx_http_write_filter.c
@@ -81,7 +81,18 @@ ngx_int_t ngx_http_write_filter(ngx_http
 #if 1
         if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) {
             ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
-                              "zero size buf in writer");
+                          "zero size buf in writer "
+                          "t:%d r:%d f:%d %p %p-%p %p %O-%O",
+                          cl->buf->temporary,
+                          cl->buf->recycled,
+                          cl->buf->in_file,
+                          cl->buf->start,
+                          cl->buf->pos,
+                          cl->buf->last,
+                          cl->buf->file,
+                          cl->buf->file_pos,
+                          cl->buf->file_last);
+
             ngx_debug_point();
         }
 #endif
@@ -120,7 +131,18 @@ ngx_int_t ngx_http_write_filter(ngx_http
 #if 1
         if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) {
             ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
-                              "zero size buf in writer");
+                          "zero size buf in writer "
+                          "t:%d r:%d f:%d %p %p-%p %p %O-%O",
+                          cl->buf->temporary,
+                          cl->buf->recycled,
+                          cl->buf->in_file,
+                          cl->buf->start,
+                          cl->buf->pos,
+                          cl->buf->last,
+                          cl->buf->file,
+                          cl->buf->file_pos,
+                          cl->buf->file_last);
+
             ngx_debug_point();
         }
 #endif
@@ -161,15 +183,16 @@ ngx_int_t ngx_http_write_filter(ngx_http
     }
 
     if (size == 0 && !c->buffered) {
-        if (!last) {
-            ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
-                          "the http output chain is empty");
+        if (last) {
+            return NGX_OK;
+        }
 
-            ngx_debug_point();
+        ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+                      "the http output chain is empty");
 
-            return NGX_ERROR;
-        }
-        return NGX_OK;
+        ngx_debug_point();
+
+        return NGX_ERROR;
     }
 
     sent = c->sent;
@@ -192,7 +215,7 @@ ngx_int_t ngx_http_write_filter(ngx_http
 
     ctx->out = chain;
 
-    if (chain || c->buffered) {
+    if (chain || (last && c->buffered)) {
         return NGX_AGAIN;
     }