mirror of
https://github.com/nginx/nginx.git
synced 2026-10-11 12:31:14 +00:00
Added r->state reset on fastcgi/scgi/uwsgi request start.
Failing to do so results in problems if 400 or 414 requests are redirected to fastcgi/scgi/uwsgi upstream, as well as after invalid headers got from upstream. This was already fixed for proxy in r3478, but fastcgi (the only affected protocol at that time) was missed. Reported by Matthieu Tourne.
This commit is contained in:
parent
e0e1c4567c
commit
b34f84d8de
3 changed files with 7 additions and 0 deletions
|
|
@ -619,6 +619,7 @@ ngx_http_fastcgi_handler(ngx_http_request_t *r)
|
|||
u->process_header = ngx_http_fastcgi_process_header;
|
||||
u->abort_request = ngx_http_fastcgi_abort_request;
|
||||
u->finalize_request = ngx_http_fastcgi_finalize_request;
|
||||
r->state = 0;
|
||||
|
||||
u->buffering = 1;
|
||||
|
||||
|
|
@ -1194,6 +1195,8 @@ ngx_http_fastcgi_reinit_request(ngx_http_request_t *r)
|
|||
f->fastcgi_stdout = 0;
|
||||
f->large_stderr = 0;
|
||||
|
||||
r->state = 0;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -434,6 +434,7 @@ ngx_http_scgi_handler(ngx_http_request_t *r)
|
|||
u->process_header = ngx_http_scgi_process_status_line;
|
||||
u->abort_request = ngx_http_scgi_abort_request;
|
||||
u->finalize_request = ngx_http_scgi_finalize_request;
|
||||
r->state = 0;
|
||||
|
||||
u->buffering = scf->upstream.buffering;
|
||||
|
||||
|
|
@ -843,6 +844,7 @@ ngx_http_scgi_reinit_request(ngx_http_request_t *r)
|
|||
status->end = NULL;
|
||||
|
||||
r->upstream->process_header = ngx_http_scgi_process_status_line;
|
||||
r->state = 0;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,6 +467,7 @@ ngx_http_uwsgi_handler(ngx_http_request_t *r)
|
|||
u->process_header = ngx_http_uwsgi_process_status_line;
|
||||
u->abort_request = ngx_http_uwsgi_abort_request;
|
||||
u->finalize_request = ngx_http_uwsgi_finalize_request;
|
||||
r->state = 0;
|
||||
|
||||
u->buffering = uwcf->upstream.buffering;
|
||||
|
||||
|
|
@ -883,6 +884,7 @@ ngx_http_uwsgi_reinit_request(ngx_http_request_t *r)
|
|||
status->end = NULL;
|
||||
|
||||
r->upstream->process_header = ngx_http_uwsgi_process_status_line;
|
||||
r->state = 0;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue