]> git.kaiwu.me - nginx.git/commitdiff
fix FastCGI "zero size buf" alert,
authorIgor Sysoev <igor@sysoev.ru>
Thu, 18 Jan 2007 07:07:55 +0000 (07:07 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 18 Jan 2007 07:07:55 +0000 (07:07 +0000)
the previous commit did not fix too

src/event/ngx_event_pipe.c

index 0809f9bae154e7b6cb2b983fbc89c3e2467b0bd7..a22cdcc0cd922681abfc51d8f08fbd14ae8ddf8b 100644 (file)
@@ -518,19 +518,12 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
                 cl = p->out;
 
                 if (cl->buf->recycled
-                    && 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);
@@ -550,6 +543,15 @@ ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
                 {
                     if (!prev_last_shadow) {
                         p->in = p->in->next;
+
+                        cl->next = NULL;
+
+                        if (out) {
+                            *ll = cl;
+                        } else {
+                            out = cl;
+                        }
+                        ll = &cl->next;
                     }
 
                     flush = 1;