diff src/http/ngx_http_output_filter.c @ 76:6127d7075471

nginx-0.0.1-2003-04-15-19:06:52 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 15 Apr 2003 15:06:52 +0000
parents 869b10be682f
children a7e45c45a95c
line wrap: on
line diff
--- a/src/http/ngx_http_output_filter.c
+++ b/src/http/ngx_http_output_filter.c
@@ -65,7 +65,7 @@ static int (*next_filter) (ngx_http_requ
 
 #define need_to_copy(r, hunk)                                             \
             (((r->filter & NGX_HTTP_FILTER_NEED_IN_MEMORY)                \
-               && (hunk->type & NGX_HUNK_FILE))                           \
+               && (hunk->type & NGX_HUNK_IN_MEMORY) == 0)                 \
              || ((r->filter & NGX_HTTP_FILTER_NEED_TEMP)                  \
                   && (hunk->type & (NGX_HUNK_MEMORY|NGX_HUNK_MMAP))))
 
@@ -257,12 +257,12 @@ static int ngx_http_output_filter_copy_h
     }
 
     if (src->type & NGX_HUNK_IN_MEMORY) {
-        ngx_memcpy(src->pos, dst->pos, size);
+        ngx_memcpy(dst->pos, src->pos, size);
         src->pos += size;
         dst->last += size;
 
         if (src->type & NGX_HUNK_FILE) {
-            src->file_pos += n;
+            src->file_pos += size;
         }
 
         if ((src->type & NGX_HUNK_LAST) && src->pos == src->last) {