Latest update - 9194

This commit is contained in:
2023-12-12 23:44:38 +09:00
parent 802d902f2d
commit b4745d7a71
9 changed files with 228 additions and 114 deletions
-3
View File
@@ -451,19 +451,16 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
switch (ch) {
case '/':
r->port_end = p;
r->uri_start = p;
state = sw_after_slash_in_uri;
break;
case '?':
r->port_end = p;
r->uri_start = p;
r->args_start = p + 1;
r->empty_path_in_uri = 1;
state = sw_uri;
break;
case ' ':
r->port_end = p;
/*
* use single "/" from request line to preserve pointers,
* if request line will be copied to large client buffer
+25 -12
View File
@@ -1718,14 +1718,23 @@ ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
r->request_end = new + (r->request_end - old);
}
r->method_end = new + (r->method_end - old);
if (r->method_end) {
r->method_end = new + (r->method_end - old);
}
r->uri_start = new + (r->uri_start - old);
r->uri_end = new + (r->uri_end - old);
if (r->uri_start) {
r->uri_start = new + (r->uri_start - old);
}
if (r->uri_end) {
r->uri_end = new + (r->uri_end - old);
}
if (r->schema_start) {
r->schema_start = new + (r->schema_start - old);
r->schema_end = new + (r->schema_end - old);
if (r->schema_end) {
r->schema_end = new + (r->schema_end - old);
}
}
if (r->host_start) {
@@ -1735,11 +1744,6 @@ ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
}
}
if (r->port_start) {
r->port_start = new + (r->port_start - old);
r->port_end = new + (r->port_end - old);
}
if (r->uri_ext) {
r->uri_ext = new + (r->uri_ext - old);
}
@@ -1754,9 +1758,18 @@ ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
} else {
r->header_name_start = new;
r->header_name_end = new + (r->header_name_end - old);
r->header_start = new + (r->header_start - old);
r->header_end = new + (r->header_end - old);
if (r->header_name_end) {
r->header_name_end = new + (r->header_name_end - old);
}
if (r->header_start) {
r->header_start = new + (r->header_start - old);
}
if (r->header_end) {
r->header_end = new + (r->header_end - old);
}
}
r->header_in = b;
-2
View File
@@ -597,8 +597,6 @@ struct ngx_http_request_s {
u_char *schema_end;
u_char *host_start;
u_char *host_end;
u_char *port_start;
u_char *port_end;
unsigned http_minor:16;
unsigned http_major:16;