Connection upgrade support in uwsgi and scgi modules.

Prodded by Roberto De Ioris.
This commit is contained in:
Maxim Dounin 2013-02-20 16:41:05 +00:00
parent 59db08a6fc
commit 208fc03e7c
2 changed files with 18 additions and 2 deletions

View File

@ -984,7 +984,7 @@ ngx_http_scgi_process_header(ngx_http_request_t *r)
u = r->upstream;
if (u->headers_in.status_n) {
return NGX_OK;
goto done;
}
if (u->headers_in.status) {
@ -1015,6 +1015,14 @@ ngx_http_scgi_process_header(ngx_http_request_t *r)
u->state->status = u->headers_in.status_n;
}
done:
if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
&& r->headers_in.upgrade)
{
u->upgrade = 1;
}
return NGX_OK;
}

View File

@ -1018,7 +1018,7 @@ ngx_http_uwsgi_process_header(ngx_http_request_t *r)
u = r->upstream;
if (u->headers_in.status_n) {
return NGX_OK;
goto done;
}
if (u->headers_in.status) {
@ -1049,6 +1049,14 @@ ngx_http_uwsgi_process_header(ngx_http_request_t *r)
u->state->status = u->headers_in.status_n;
}
done:
if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
&& r->headers_in.upgrade)
{
u->upgrade = 1;
}
return NGX_OK;
}