diff src/http/ngx_http_write_filter.c @ 3:34a521b1a148

nginx-0.0.1-2002-08-20-18:48:28 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 20 Aug 2002 14:48:28 +0000
parents d220029ac7f3
children c5f071d376e5
line wrap: on
line diff
--- a/src/http/ngx_http_write_filter.c
+++ b/src/http/ngx_http_write_filter.c
@@ -34,7 +34,7 @@ int ngx_http_write_filter(ngx_http_reque
 
     ctx = (ngx_http_write_filter_ctx_t *)
                               ngx_get_module_ctx(r->main ? r->main : r,
-                                                &ngx_http_write_filter_module);
+                                                 &ngx_http_write_filter_module);
     size = flush = 0;
     last = 0;
     prev = &ctx->out;
@@ -44,6 +44,10 @@ int ngx_http_write_filter(ngx_http_reque
         prev = &ch->next;
         size += ch->hunk->last.file - ch->hunk->pos.file;
 
+        ngx_log_debug(r->connection->log, "old chunk: %x %qx %qd" _
+                      ch->hunk->type _ ch->hunk->pos.file _
+                      ch->hunk->last.file - ch->hunk->pos.file);
+
         if (ch->hunk->type & NGX_HUNK_FLUSH)
             flush = size;
 
@@ -62,6 +66,10 @@ int ngx_http_write_filter(ngx_http_reque
         prev = &ch->next;
         size += ch->hunk->last.file - ch->hunk->pos.file;
 
+        ngx_log_debug(r->connection->log, "new chunk: %x %qx %qd" _
+                      ch->hunk->type _ ch->hunk->pos.file _
+                      ch->hunk->last.file - ch->hunk->pos.file);
+
         if (ch->hunk->type & NGX_HUNK_FLUSH)
             flush = size;
 
@@ -69,7 +77,7 @@ int ngx_http_write_filter(ngx_http_reque
             last = 1;
     }
 
-    if (flush == 0 && size < ctx->buffer_output)
+    if (!last && flush == 0 && size < ctx->buffer_output)
         return NGX_HTTP_FILTER_DONE;
 
     chain = ngx_event_write(r->connection, ctx->out, flush);