]> git.kaiwu.me - nginx.git/commitdiff
FastCGI: fixed wrong connection close with fastcgi_keep_conn.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 1 Feb 2013 14:40:19 +0000 (14:40 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 1 Feb 2013 14:40:19 +0000 (14:40 +0000)
With fastcgi_keep_conn it was possible that connection was closed after
FCGI_STDERR record with zero padding and without any further data read yet.
This happended as f->state was set to ngx_http_fastcgi_st_padding and then
"break" happened, resulting in p->length being set to f->padding, i.e. 0
(which in turn resulted in connection close).

Fix is to make sure we continue the loop after f->state is set.

src/http/modules/ngx_http_fastcgi_module.c

index 123125a86a0f10b24af6960e1f6b23b27a43667c..5e8ef40c1a8c62b15189fd5d4aa263069a9d68a7 100644 (file)
@@ -1788,10 +1788,6 @@ ngx_http_fastcgi_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
                               "FastCGI sent in stderr: \"%*s\"",
                               m + 1 - msg, msg);
 
-                if (f->pos == f->last) {
-                    break;
-                }
-
             } else {
                 if (f->padding) {
                     f->state = ngx_http_fastcgi_st_padding;