]> git.kaiwu.me - nginx.git/commitdiff
do not free buffer with cache header before it would be written,
authorIgor Sysoev <igor@sysoev.ru>
Mon, 4 May 2009 19:04:00 +0000 (19:04 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 4 May 2009 19:04:00 +0000 (19:04 +0000)
it seems this affected header only FastCGI responses only:
proxied header only responses were cached right

src/event/ngx_event_pipe.c

index c13d2ea5a289615671fc34f56e138607d8447375..5d5035ce2615d587fad6a0149a619fc06eef571c 100644 (file)
@@ -397,7 +397,7 @@ ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
 
         p->free_raw_bufs = p->free_raw_bufs->next;
 
-        if (p->free_bufs) {
+        if (p->free_bufs && p->buf_to_file == NULL) {
             for (cl = p->free_raw_bufs; cl; cl = cl->next) {
                 if (cl->buf->shadow == NULL) {
                     ngx_pfree(p->pool, cl->buf->start);