diff src/http/ngx_http_request.c @ 8664:f61d347158d0 quic

Merged with the default branch.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 15 Dec 2020 16:55:43 +0000
parents 9dce2978e4fd 2fec22332ff4
children e1eb7f4ca9f1
line wrap: on
line diff
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -1298,9 +1298,13 @@ ngx_http_process_request_uri(ngx_http_re
         r->uri.len = r->uri_end - r->uri_start;
     }
 
-    if (r->complex_uri || r->quoted_uri) {
-
-        r->uri.data = ngx_pnalloc(r->pool, r->uri.len + 1);
+    if (r->complex_uri || r->quoted_uri || r->empty_path_in_uri) {
+
+        if (r->empty_path_in_uri) {
+            r->uri.len++;
+        }
+
+        r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
         if (r->uri.data == NULL) {
             ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
             return NGX_ERROR;
@@ -1324,7 +1328,7 @@ ngx_http_process_request_uri(ngx_http_re
     r->unparsed_uri.len = r->uri_end - r->uri_start;
     r->unparsed_uri.data = r->uri_start;
 
-    r->valid_unparsed_uri = r->space_in_uri ? 0 : 1;
+    r->valid_unparsed_uri = (r->space_in_uri || r->empty_path_in_uri) ? 0 : 1;
 
     if (r->uri_ext) {
         if (r->args_start) {
@@ -3553,8 +3557,6 @@ ngx_http_set_lingering_close(ngx_connect
             c->ssl->handler = ngx_http_set_lingering_close;
             return;
         }
-
-        c->recv = ngx_recv;
     }
 #endif