aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_output_chain.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-04-18 19:06:02 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-04-18 19:06:02 +0000
commit9bfb434d241816749077e21f499b8efd41c3625d (patch)
treedefc89b07684b0bd31b77dd61825893e434392ba /src/core/ngx_output_chain.c
parent32075f53e94183c647da58d4d832a58725d36c49 (diff)
downloadnginx-9bfb434d241816749077e21f499b8efd41c3625d.tar.gz
nginx-9bfb434d241816749077e21f499b8efd41c3625d.zip
nginx-0.0.3-2004-04-18-23:06:02 import
Diffstat (limited to 'src/core/ngx_output_chain.c')
-rw-r--r--src/core/ngx_output_chain.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/ngx_output_chain.c b/src/core/ngx_output_chain.c
index 285bd8340..94e410495 100644
--- a/src/core/ngx_output_chain.c
+++ b/src/core/ngx_output_chain.c
@@ -20,7 +20,7 @@ int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
ngx_chain_t *cl, *out, **last_out;
/*
- * the short path for the case when the chain ctx->in is empty
+ * the short path for the case when the ctx->in chain is empty
* and the incoming chain is empty too or it has the single hunk
* that does not require the copy
*/
@@ -54,9 +54,14 @@ int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
while (ctx->in) {
+ /*
+ * cycle while there are the ctx->in hunks
+ * or there are the free output hunks to copy in
+ */
+
if (!ngx_output_chain_need_to_copy(ctx, ctx->in->hunk)) {
- /* move the chain link to the chain out */
+ /* move the chain link to the output chain */
cl = ctx->in;
ctx->in = cl->next;
@@ -133,7 +138,7 @@ int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
return rc;
}
- /* delete the completed hunk from the chain ctx->in */
+ /* delete the completed hunk from the ctx->in chain */
if (ngx_hunk_size(ctx->in->hunk) == 0) {
ctx->in = ctx->in->next;
@@ -157,6 +162,10 @@ int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
ngx_chain_update_chains(&ctx->free, &ctx->busy, &out, ctx->tag);
last_out = &out;
+
+ if (last == NGX_ERROR) {
+ return last;
+ }
}
}