diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-01-17 16:10:40 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-01-17 16:10:40 +0000 |
commit | aafa2004d7bb9b3a9cb9970d793a136de85517c3 (patch) | |
tree | 022336c2df3d5e59f0f066c652ba3da2f75dc1e1 /src | |
parent | ecef14e307437b5b0142ae324598ec8247a18084 (diff) | |
download | nginx-aafa2004d7bb9b3a9cb9970d793a136de85517c3.tar.gz nginx-aafa2004d7bb9b3a9cb9970d793a136de85517c3.zip |
fix FastCGI "zero size buf" alert,
r841 did not fix it
Diffstat (limited to 'src')
-rw-r--r-- | src/event/ngx_event_pipe.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/event/ngx_event_pipe.c b/src/event/ngx_event_pipe.c index 0239bd105..0809f9bae 100644 --- a/src/event/ngx_event_pipe.c +++ b/src/event/ngx_event_pipe.c @@ -420,7 +420,7 @@ static ngx_int_t ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) { size_t bsize; - ngx_uint_t flush; + ngx_uint_t flush, prev_last_shadow; ngx_chain_t *out, **ll, *cl; ngx_connection_t *downstream; @@ -511,6 +511,7 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) out = NULL; ll = NULL; flush = 0; + prev_last_shadow = 1; for ( ;; ) { if (p->out) { @@ -520,10 +521,16 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) && cl->buf->last_shadow && bsize + cl->buf->last - cl->buf->pos > p->busy_size) { + if (!prev_last_shadow) { + p->in = p->in->next; + } + flush = 1; break; } + prev_last_shadow = cl->buf->last_shadow; + p->out = p->out->next; ngx_event_pipe_free_shadow_raw_buf(&p->free_raw_bufs, cl->buf); @@ -541,10 +548,16 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p) && cl->buf->last_shadow && bsize + cl->buf->last - cl->buf->pos > p->busy_size) { + if (!prev_last_shadow) { + p->in = p->in->next; + } + flush = 1; break; } + prev_last_shadow = cl->buf->last_shadow; + p->in = p->in->next; } else { |