Mercurial > hg > nginx
diff src/http/ngx_http_output_filter.c @ 94:8220378432a8
nginx-0.0.1-2003-05-22-19:23:47 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 22 May 2003 15:23:47 +0000 |
parents | 637625a2acdb |
children | b48066122884 |
line wrap: on
line diff
--- a/src/http/ngx_http_output_filter.c Wed May 21 13:28:21 2003 +0000 +++ b/src/http/ngx_http_output_filter.c Thu May 22 15:23:47 2003 +0000 @@ -58,15 +58,6 @@ #define next_filter (*ngx_http_top_body_filter) -#if 0 -static int (*next_filter) (ngx_http_request_t *r, ngx_chain_t *ch); -#endif - - -#if 0 -#define next_filter ngx_http_output_filter_module_ctx.next_output_body_filter -#endif - #define need_to_copy(r, hunk) \ (((r->filter & NGX_HTTP_FILTER_NEED_IN_MEMORY) \ && (hunk->type & NGX_HUNK_IN_MEMORY) == 0) \ @@ -159,6 +150,8 @@ return rc; } +ngx_log_debug(r->connection->log, "HERE"); + /* NGX_OK */ /* set our hunk free */ ctx->hunk->pos = ctx->hunk->last = ctx->hunk->start; @@ -211,6 +204,20 @@ return rc; } #endif + + if (ctx->incoming->hunk->type & NGX_HUNK_IN_MEMORY) { + size = ctx->incoming->hunk->last - ctx->incoming->hunk->pos; + + } else { + size = ctx->incoming->hunk->file_last + - ctx->incoming->hunk->file_pos; + } + + /* delete the completed hunk from the incoming chain */ + if (size == 0) { + ctx->incoming = ctx->incoming->next; + } + ctx->out.hunk = ctx->hunk; ctx->out.next = NULL; @@ -226,19 +233,8 @@ /* repeat until we will have copied the whole first hunk from the chain ctx->incoming */ - if (ctx->incoming->hunk->type & NGX_HUNK_IN_MEMORY) { - size = ctx->incoming->hunk->last - ctx->incoming->hunk->pos; - - } else { - size = ctx->incoming->hunk->file_last - - ctx->incoming->hunk->file_pos; - } - } while (size); - /* delete the completed hunk from the incoming chain */ - ctx->incoming = ctx->incoming->next; - /* repeat until we will have processed the whole chain ctx->incoming */ } while (ctx->incoming); @@ -276,6 +272,12 @@ } else { n = ngx_read_file(src->file, dst->pos, size, src->file_pos); +if (n == 0) { +ngx_log_debug(src->file->log, "READ: %qd:%qd %X:%X %X:%X" _ + src->file_pos _ src->file_last _ + dst->pos _ dst->last _ dst->start _ dst->end); +} + if (n == NGX_ERROR) { return n; }