Mercurial > hg > nginx
changeset 5353:1608b1135a1d
Upstream: setting u->header_sent before ngx_http_upstream_upgrade().
Without u->header_sent set a special response might be generated following
an upgraded connection. The problem appeared in 1ccdda1f37f3 (1.5.3).
Catched by "header already sent" alerts in 1.5.4 after upstream timeouts.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 30 Aug 2013 21:44:16 +0400 |
parents | ec0be12c8e29 |
children | 62be77b0608f |
files | src/http/ngx_http_upstream.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c Thu Aug 29 22:35:54 2013 +0400 +++ b/src/http/ngx_http_upstream.c Fri Aug 30 21:44:16 2013 +0400 @@ -2105,6 +2105,8 @@ return; } + u->header_sent = 1; + if (u->upgrade) { ngx_http_upstream_upgrade(r, u); return; @@ -2131,8 +2133,6 @@ } } - u->header_sent = 1; - if (r->request_body && r->request_body->temp_file) { ngx_pool_run_cleanup_file(r->pool, r->request_body->temp_file->file.fd); r->request_body->temp_file->file.fd = NGX_INVALID_FILE;