aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-03-18 13:46:35 +0300
committerRoman Arutyunyan <arut@nginx.com>2020-03-18 13:46:35 +0300
commit01dc7445f0fc392edd4f4e23f4fa1af69af68e41 (patch)
tree657cd38c8b0c6d5c2ef1cfda26a8e9ccbdddbb5e /src/http/ngx_http_request.c
parent023dbc3cfb73793ac84557ee0d228e63a6cd2308 (diff)
downloadnginx-01dc7445f0fc392edd4f4e23f4fa1af69af68e41.tar.gz
nginx-01dc7445f0fc392edd4f4e23f4fa1af69af68e41.zip
Refactored HTTP/3 parser.
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r--src/http/ngx_http_request.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 85b090d5f..166d8ffba 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1163,7 +1163,7 @@ ngx_http_process_request_line(ngx_event_t *rev)
switch (r->http_version) {
#if (NGX_HTTP_V3)
case NGX_HTTP_VERSION_30:
- rc = ngx_http_v3_parse_header(r, r->header_in, 1);
+ rc = ngx_http_v3_parse_header(r, r->header_in);
break;
#endif
@@ -1510,7 +1510,7 @@ ngx_http_process_request_headers(ngx_event_t *rev)
switch (r->http_version) {
#if (NGX_HTTP_V3)
case NGX_HTTP_VERSION_30:
- rc = ngx_http_v3_parse_header(r, r->header_in, 0);
+ rc = ngx_http_v3_parse_header(r, r->header_in);
break;
#endif
@@ -1547,11 +1547,17 @@ ngx_http_process_request_headers(ngx_event_t *rev)
h->key.len = r->header_name_end - r->header_name_start;
h->key.data = r->header_name_start;
- h->key.data[h->key.len] = '\0';
+
+ if (h->key.data[h->key.len]) {
+ h->key.data[h->key.len] = '\0';
+ }
h->value.len = r->header_end - r->header_start;
h->value.data = r->header_start;
- h->value.data[h->value.len] = '\0';
+
+ if (h->value.data[h->value.len]) {
+ h->value.data[h->value.len] = '\0';
+ }
h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
if (h->lowcase_key == NULL) {