]> git.kaiwu.me - nginx.git/commitdiff
fix endless loop when too many FastCGI sent too many to stderr
authorIgor Sysoev <igor@sysoev.ru>
Sat, 18 Nov 2006 21:46:16 +0000 (21:46 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 18 Nov 2006 21:46:16 +0000 (21:46 +0000)
src/event/ngx_event_pipe.c

index bb371691bcb662cc8d2fc21e0fea5cf79e0ae31d..c535357e0c1a478f614639ac022037688ed46b4e 100644 (file)
@@ -295,6 +295,7 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
 
         p->read_length += n;
         cl = chain;
+        p->free_raw_bufs = NULL;
 
         while (cl && n > 0) {
 
@@ -322,7 +323,14 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
             }
         }
 
-        p->free_raw_bufs = cl;
+        if (cl) {
+            while (cl->next) {
+                cl = cl->next;
+            }
+
+            cl->next = p->free_raw_bufs;
+            p->free_raw_bufs = cl;
+        }
     }
 
 #if (NGX_DEBUG)