From 26ac1c73f0fe90c77cbad84a6b4ef5712e35ba52 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Fri, 28 Feb 2020 13:09:51 +0300 Subject: Initial QUIC support in http. --- src/http/ngx_http_request.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 70c2d424d..8cc5d6432 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -323,6 +323,7 @@ typedef struct { ngx_chain_t *free; unsigned ssl:1; + unsigned quic:1; unsigned proxy_protocol:1; } ngx_http_connection_t; -- cgit v1.2.3 From 7739b6073b11086d9a3dc4b9744418070e182c33 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Fri, 13 Mar 2020 19:36:33 +0300 Subject: HTTP/3. --- src/http/ngx_http_request.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 8cc5d6432..04d88db7b 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -24,6 +24,7 @@ #define NGX_HTTP_VERSION_10 1000 #define NGX_HTTP_VERSION_11 1001 #define NGX_HTTP_VERSION_20 2000 +#define NGX_HTTP_VERSION_30 3000 #define NGX_HTTP_UNKNOWN 0x0001 #define NGX_HTTP_GET 0x0002 @@ -584,6 +585,7 @@ struct ngx_http_request_s { u_char *args_start; u_char *request_start; u_char *request_end; + u_char *method_start; u_char *method_end; u_char *schema_start; u_char *schema_end; @@ -592,6 +594,17 @@ struct ngx_http_request_s { u_char *port_start; u_char *port_end; +#if (NGX_HTTP_V3) + ngx_uint_t h3_length; + ngx_uint_t h3_index; + ngx_uint_t h3_insert_count; + ngx_uint_t h3_sign; + ngx_uint_t h3_delta_base; + ngx_uint_t h3_huffman; + ngx_uint_t h3_dynamic; + ngx_uint_t h3_offset; +#endif + unsigned http_minor:16; unsigned http_major:16; }; -- cgit v1.2.3 From 01dc7445f0fc392edd4f4e23f4fa1af69af68e41 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 18 Mar 2020 13:46:35 +0300 Subject: Refactored HTTP/3 parser. --- src/http/ngx_http_request.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 04d88db7b..772d53b2d 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -595,14 +595,7 @@ struct ngx_http_request_s { u_char *port_end; #if (NGX_HTTP_V3) - ngx_uint_t h3_length; - ngx_uint_t h3_index; - ngx_uint_t h3_insert_count; - ngx_uint_t h3_sign; - ngx_uint_t h3_delta_base; - ngx_uint_t h3_huffman; - ngx_uint_t h3_dynamic; - ngx_uint_t h3_offset; + void *h3_parse; #endif unsigned http_minor:16; -- cgit v1.2.3 From d6b6b6dfc57c916dc7990504fffe71248421456d Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Tue, 19 May 2020 15:47:37 +0300 Subject: Fixed $request_length for HTTP/3. New field r->parse_start is introduced to substitute r->request_start and r->header_name_start for request length accounting. These fields only work for this purpose in HTTP/1 because HTTP/1 request line and header line start with these values. Also, error logging is now fixed to output the right part of the request. --- src/http/ngx_http_request.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 772d53b2d..1994000a4 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -579,6 +579,7 @@ struct ngx_http_request_s { * via ngx_http_ephemeral_t */ + u_char *parse_start; u_char *uri_start; u_char *uri_end; u_char *uri_ext; -- cgit v1.2.3 From b813b9ec358862a2a94868bc057420d6eca5c05d Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Tue, 21 Jul 2020 23:09:22 +0300 Subject: QUIC: added "quic" listen parameter. The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there --- src/http/ngx_http_request.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 1994000a4..3d33d93d4 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -324,7 +324,6 @@ typedef struct { ngx_chain_t *free; unsigned ssl:1; - unsigned quic:1; unsigned proxy_protocol:1; } ngx_http_connection_t; -- cgit v1.2.3 From 7cfc5eb11fbfe3beb9d793dbacae70fb658d46c2 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 25 Nov 2020 17:57:43 +0000 Subject: HTTP/3: eliminated r->method_start. The field was introduced to ease parsing HTTP/3 requests. The change reduces diff to the default branch. --- src/http/ngx_http_request.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 3d33d93d4..9a610e805 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -585,7 +585,6 @@ struct ngx_http_request_s { u_char *args_start; u_char *request_start; u_char *request_end; - u_char *method_start; u_char *method_end; u_char *schema_start; u_char *schema_end; -- cgit v1.2.3 From 9e489d208fff35c490b43980a064c38cc8dc4f2c Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Fri, 22 Jan 2021 16:34:06 +0300 Subject: HTTP/3: refactored request parser. The change reduces diff to the default branch for src/http/ngx_http_request.c and src/http/ngx_http_parse.c. --- src/http/ngx_http_request.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 518c2f4d1..4121e3c3b 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -325,6 +325,7 @@ typedef struct { unsigned ssl:1; unsigned proxy_protocol:1; + unsigned http3:1; } ngx_http_connection_t; @@ -581,7 +582,6 @@ struct ngx_http_request_s { * via ngx_http_ephemeral_t */ - u_char *parse_start; u_char *uri_start; u_char *uri_end; u_char *uri_ext; -- cgit v1.2.3 From ffb099bf52e70c0cbdb1ed5555645f12ec6b2322 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 17 Feb 2021 15:56:34 +0300 Subject: HTTP/3: introduced ngx_http_v3_parse_t structure. The structure is used to parse an HTTP/3 request. An object of this type is added to ngx_http_request_t instead of h3_parse generic pointer. Also, the new field is located outside of the request ephemeral zone to keep it safe after request headers are parsed. --- src/http/ngx_http_request.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 4121e3c3b..5231ad6f2 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -447,6 +447,7 @@ struct ngx_http_request_s { ngx_http_connection_t *http_connection; ngx_http_v2_stream_t *stream; + ngx_http_v3_parse_t *v3_parse; ngx_http_log_handler_pt log_handler; @@ -596,10 +597,6 @@ struct ngx_http_request_s { u_char *port_start; u_char *port_end; -#if (NGX_HTTP_V3) - void *h3_parse; -#endif - unsigned http_minor:16; unsigned http_major:16; }; -- cgit v1.2.3 From 38773a3c1130d34715f1cce24527a10258447354 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 5 May 2021 14:53:36 +0300 Subject: HTTP/3: reference h3c directly from ngx_http_connection_t. Previously, an ngx_http_v3_connection_t object was created for HTTP/3 and then assinged to c->data instead of the generic ngx_http_connection_t object. Now a direct reference is added to ngx_http_connection_t, which is less confusing and does not require a flag for http3. --- src/http/ngx_http_request.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 5231ad6f2..01ae716fe 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -318,6 +318,10 @@ typedef struct { #endif #endif +#if (NGX_HTTP_V3 || NGX_COMPAT) + ngx_http_v3_connection_t *v3_session; +#endif + ngx_chain_t *busy; ngx_int_t nbusy; @@ -325,7 +329,6 @@ typedef struct { unsigned ssl:1; unsigned proxy_protocol:1; - unsigned http3:1; } ngx_http_connection_t; -- cgit v1.2.3 From 0ea300d35eb066631a21b2042cfe9cd2ea94b15f Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 5 May 2021 12:54:10 +0300 Subject: HTTP/3: renamed ngx_http_v3_connection_t to ngx_http_v3_session_t. --- src/http/ngx_http_request.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index 01ae716fe..60ef4fec1 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -319,7 +319,7 @@ typedef struct { #endif #if (NGX_HTTP_V3 || NGX_COMPAT) - ngx_http_v3_connection_t *v3_session; + ngx_http_v3_session_t *v3_session; #endif ngx_chain_t *busy; -- cgit v1.2.3 From b6b2a45fb6824185889373cc0af070c4a90c1b4a Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Thu, 30 Sep 2021 17:14:42 +0300 Subject: Added r->response_sent flag. The flag indicates that the entire response was sent to the socket up to the last_buf flag. The flag is only usable for protocol implementations that call ngx_http_write_filter() from header filter, such as HTTP/1.x and HTTP/3. --- src/http/ngx_http_request.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/http/ngx_http_request.h') diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h index aee9109c3..a19e975b2 100644 --- a/src/http/ngx_http_request.h +++ b/src/http/ngx_http_request.h @@ -547,6 +547,7 @@ struct ngx_http_request_s { unsigned request_complete:1; unsigned request_output:1; unsigned header_sent:1; + unsigned response_sent:1; unsigned expect_tested:1; unsigned root_tested:1; unsigned done:1; -- cgit v1.2.3