# HG changeset patch # User Maxim Dounin # Date 1359729619 0 # Node ID f3f3083f12535946a0a267884fc33725a16189aa # Parent 43cb2c9799c1c372477e2f884d5ada4952a15036 FastCGI: fixed wrong connection close with fastcgi_keep_conn. 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. diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -1788,10 +1788,6 @@ ngx_http_fastcgi_input_filter(ngx_event_ "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;