diff options
author | Roman Arutyunyan <arut@nginx.com> | 2020-07-14 16:52:44 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2020-07-14 16:52:44 +0300 |
commit | 5e036a6bef567bbe4e87ce7958ab76663ed3242e (patch) | |
tree | 8171891363fde669fb117fbbc9488658e328ce81 /src | |
parent | c8a194b29aed55fee195b5e11a20af6d1eeef961 (diff) | |
download | nginx-5e036a6bef567bbe4e87ce7958ab76663ed3242e.tar.gz nginx-5e036a6bef567bbe4e87ce7958ab76663ed3242e.zip |
HTTP/3: support $server_protocol variable.
Now it holds "HTTP/3.0". Previously it was empty.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/ngx_http_parse.c | 4 | ||||
-rw-r--r-- | src/http/ngx_http_request.c | 4 | ||||
-rw-r--r-- | src/http/v3/ngx_http_v3_request.c | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c index b59a6ce4c..a351f2b27 100644 --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -833,6 +833,10 @@ done: 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; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 285879f2f..82deef674 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -1139,10 +1139,6 @@ ngx_http_process_request_line(ngx_event_t *rev) 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; } diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c index af9cbd2b3..adc40d368 100644 --- a/src/http/v3/ngx_http_v3_request.c +++ b/src/http/v3/ngx_http_v3_request.c @@ -110,6 +110,8 @@ ngx_http_v3_parse_request(ngx_http_request_t *r, ngx_buf_t *b) 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; |