Mercurial > hg > nginx
comparison src/http/modules/ngx_http_fastcgi_module.c @ 5026:f3f3083f1253
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 01 Feb 2013 14:40:19 +0000 |
parents | fd84344f1df7 |
children | 2ab25df19dc6 |
comparison
equal
deleted
inserted
replaced
5025:43cb2c9799c1 | 5026:f3f3083f1253 |
---|---|
1786 | 1786 |
1787 ngx_log_error(NGX_LOG_ERR, p->log, 0, | 1787 ngx_log_error(NGX_LOG_ERR, p->log, 0, |
1788 "FastCGI sent in stderr: \"%*s\"", | 1788 "FastCGI sent in stderr: \"%*s\"", |
1789 m + 1 - msg, msg); | 1789 m + 1 - msg, msg); |
1790 | 1790 |
1791 if (f->pos == f->last) { | |
1792 break; | |
1793 } | |
1794 | |
1795 } else { | 1791 } else { |
1796 if (f->padding) { | 1792 if (f->padding) { |
1797 f->state = ngx_http_fastcgi_st_padding; | 1793 f->state = ngx_http_fastcgi_st_padding; |
1798 } else { | 1794 } else { |
1799 f->state = ngx_http_fastcgi_st_version; | 1795 f->state = ngx_http_fastcgi_st_version; |