Mercurial > hg > nginx
changeset 8494:e334ca1b23ba quic
HTTP/3: support $server_protocol variable.
Now it holds "HTTP/3.0". Previously it was empty.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 14 Jul 2020 16:52:44 +0300 |
parents | e533a352d118 |
children | 455a8536eaa7 |
files | src/http/ngx_http_parse.c src/http/ngx_http_request.c src/http/v3/ngx_http_v3_request.c |
diffstat | 3 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c Thu Jul 23 11:40:10 2020 +0300 +++ b/src/http/ngx_http_parse.c Tue Jul 14 16:52:44 2020 +0300 @@ -833,6 +833,10 @@ r->request_end = p; } + if (r->http_protocol.data) { + r->http_protocol.len = r->request_end - r->http_protocol.data; + } + r->http_version = r->http_major * 1000 + r->http_minor; r->state = sw_start;
--- a/src/http/ngx_http_request.c Thu Jul 23 11:40:10 2020 +0300 +++ b/src/http/ngx_http_request.c Tue Jul 14 16:52:44 2020 +0300 @@ -1139,10 +1139,6 @@ r->method_name.len = r->method_end - r->method_start; r->method_name.data = r->method_start; - if (r->http_protocol.data) { - r->http_protocol.len = r->request_end - r->http_protocol.data; - } - if (ngx_http_process_request_uri(r) != NGX_OK) { break; }
--- a/src/http/v3/ngx_http_v3_request.c Thu Jul 23 11:40:10 2020 +0300 +++ b/src/http/v3/ngx_http_v3_request.c Tue Jul 14 16:52:44 2020 +0300 @@ -110,6 +110,8 @@ continue; } + ngx_str_set(&r->http_protocol, "HTTP/3.0"); + len = (r->method_end - r->method_start) + 1 + (r->uri_end - r->uri_start) + 1 + sizeof("HTTP/3") - 1;