aboutsummaryrefslogtreecommitdiff
path: root/src/http/v3
Commit message (Collapse)AuthorAge
* HTTP/3: indexed field line encoding for "103 Early Hints".Sergey Kandaurov2025-06-21
|
* Upstream: early hints support.Roman Arutyunyan2025-06-19
| | | | | | | | | | | | | | | | | The change implements processing upstream early hints response in ngx_http_proxy_module and ngx_http_grpc_module. A new directive "early_hints" enables sending early hints to the client. By default, sending early hints is disabled. Example: map $http_sec_fetch_mode $early_hints { navigate $http2$http3; } early_hints $early_hints; proxy_pass http://example.com;
* HTTP/3: fixed NGX_HTTP_V3_VARLEN_INT_LEN value.Roman Arutyunyan2025-04-18
| | | | | | | | | | | | | After fixing ngx_http_v3_encode_varlen_int() in 400eb1b628, NGX_HTTP_V3_VARLEN_INT_LEN retained the old value of 4, which is insufficient for the values over 1073741823 (1G - 1). The NGX_HTTP_V3_VARLEN_INT_LEN macro is used in ngx_http_v3_uni.c to format stream and frame types. Old buffer size is enough for formatting this data. Also, the macro is used in ngx_http_v3_filter_module.c to format output chunks and trailers. Considering output_buffers and proxy_buffer_size are below 1G in all realistic scenarios, the old buffer size is enough here as well.
* HTTP/3: graceful shutdown on keepalive timeout expiration.Roman Arutyunyan2025-04-15
| | | | | | | | | | Previously, the expiration caused QUIC connection finalization even if there are application-terminated streams finishing sending data. Such finalization terminated these streams. An easy way to trigger this is to request a large file from HTTP/3 over a small MTU. In this case keepalive timeout expiration may abruptly terminate the request stream.
* HTTP/3: fixed handling of zero-length literal field line.Sergey Kandaurov2024-05-28
| | | | Previously, st->value was passed with NULL data pointer to header handlers.
* HTTP/3: fixed dynamic table overflow.Roman Arutyunyan2024-05-28
| | | | | | | | | | | | While inserting a new entry into the dynamic table, first the entry is added, and then older entries are evicted until table size is within capacity. After the first step, the number of entries may temporarily exceed the maximum calculated from capacity by one entry, which previously caused table overflow. The easiest way to trigger the issue is to keep adding entries with empty names and values until first eviction. The issue was introduced by 987bee4363d1.
* HTTP/3: decoder stream pre-creation.Roman Arutyunyan2024-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously a decoder stream was created on demand for sending Section Acknowledgement, Stream Cancellation and Insert Count Increment. If conditions for sending any of these instructions never happen, a decoder stream is not created at all. These conditions include client not using the dynamic table and no streams abandoned by server (RFC 9204, Section 2.2.2.2). However RFC 9204, Section 4.2 defines only one condition for not creating a decoder stream: An endpoint MAY avoid creating a decoder stream if its decoder sets the maximum capacity of the dynamic table to zero. The change enables pre-creation of the decoder stream at HTTP/3 session initialization if maximum dynamic table capacity is not zero. Note that this value is currently hardcoded to 4096 bytes and is not configurable, so the stream is now always created. Also, the change fixes a potential stack overflow when creating a decoder stream in ngx_http_v3_send_cancel_stream() while draining a request stream by ngx_drain_connections(). Creating a decoder stream involves calling ngx_get_connection(), which calls ngx_drain_connections(), which will drain the same request stream again. If client's MAX_STREAMS for uni stream is high enough, these recursive calls will continue until we run out of stack. Otherwise, decoder stream creation will fail at some point and the request stream connection will be drained. This may result in use-after-free, since this connection could still be referenced up the stack.
* HTTP/3: fixed handling of malformed request body length.Sergey Kandaurov2024-05-03
| | | | | | | Previously, a request body larger than declared in Content-Length resulted in a 413 status code, because Content-Length was mistakenly used as the maximum allowed request body, similar to client_max_body_size. Following the HTTP/3 specification, such requests are now rejected with the 400 error as malformed.
* HTTP/3: added Huffman decoding error logging.Sergey Kandaurov2023-11-14
|
* HTTP/3: postponed session creation to init() callback.Roman Arutyunyan2023-09-14
| | | | | | | | | | | | | | Now the session object is assigned to c->data while ngx_http_connection_t object is referenced by its http_connection field, similar to ngx_http_v2_connection_t and ngx_http_request_t. The change allows to eliminate v3_session field from ngx_http_connection_t. The field was under NGX_HTTP_V3 macro, which was a source of binary compatibility problems when nginx/module is build with/without HTTP/3 support. Postponing is essential since c->data should retain the reference to ngx_http_connection_t object throughout QUIC handshake, because SSL callbacks ngx_http_ssl_servername() and ngx_http_ssl_alpn_select() rely on this.
* HTTP/3: moved variable initialization.Roman Arutyunyan2023-09-13
|
* QUIC: "handshake_timeout" configuration parameter.Roman Arutyunyan2023-09-13
| | | | | | | | Previously QUIC did not have such parameter and handshake duration was controlled by HTTP/3. However that required creating and storing HTTP/3 session on first client datagram. Apparently there's no convenient way to store the session object until QUIC handshake is complete. In the followup patches session creation will be postponed to init() callback.
* HTTP/3: fixed $body_bytes_sent.Sergey Kandaurov2023-07-12
|
* HTTP/3: removed server push support.Roman Arutyunyan2023-05-12
|
* QUIC: style.Maxim Dounin2023-05-11
|
* HTTP/3: removed "http3" parameter of "listen" directive.Roman Arutyunyan2023-05-11
| | | | The parameter has been deprecated since c851a2ed5ce8.
* QUIC: removed "quic_mtu" directive.Roman Arutyunyan2023-05-11
| | | | | | | | | | | | | | The directive used to set the value of the "max_udp_payload_size" transport parameter. According to RFC 9000, Section 18.2, the value specifies the size of buffer for reading incoming datagrams: This limit does act as an additional constraint on datagram size in the same way as the path MTU, but it is a property of the endpoint and not the path; see Section 14. It is expected that this is the space an endpoint dedicates to holding incoming packets. Current QUIC implementation uses the maximum possible buffer size (65527) for reading datagrams.
* HTTP/3: fixed ngx_http_v3_init_session() error handling.Sergey Kandaurov2023-05-04
| | | | A QUIC connection is not usable yet at this early stage of spin up.
* HTTP/3: fixed CANCEL_PUSH handling.Sergey Kandaurov2023-04-06
|
* HTTP/3: "quic" parameter of "listen" directive.Roman Arutyunyan2023-02-27
| | | | | | | | | Now "listen" directve has a new "quic" parameter which enables QUIC protocol for the address. Further, to enable HTTP/3, a new directive "http3" is introduced. The hq-interop protocol is enabled by "http3_hq" as before. Now application protocol is chosen by ALPN. Previously used "http3" parameter of "listen" is deprecated.
* HTTP/3: insert count block timeout.Roman Arutyunyan2023-01-05
| | | | | | Previously, there was no timeout for a request stream blocked on insert count, which could result in infinite wait. Now client_header_timeout is set when stream is first blocked.
* HTTP/3: trigger 400 (Bad Request) on stream error while blocked.Roman Arutyunyan2023-01-05
| | | | | Previously, stream was closed with NGX_HTTP_CLOSE. However, in a similar case when recv() returns eof or error, status 400 is triggered.
* HTTP/3: fixed $connection_time.Sergey Kandaurov2023-01-10
| | | | | | Previously, start_time wasn't set for a new stream. The fix is to derive it from the parent connection. Also it's used to simplify tracking keepalive_time.
* HTTP/3: handled insertion reference to a going to be evicted entry.Roman Arutyunyan2023-01-03
| | | | | | | | | | | | As per RFC 9204, section 3.2.2, a new entry can reference an entry in the dynamic table that will be evicted when adding this new entry into the dynamic table. Previously, such inserts resulted in use-after-free since the old entry was evicted before the insertion (ticket #2431). Now it's evicted after the insertion. This change fixes Insert with Name Reference and Duplicate encoder instructions.
* HTTP/3: implement keepalive for hq.Roman Arutyunyan2022-10-25
| | | | | | | | Previously, keepalive timer was deleted in ngx_http_v3_wait_request_handler() and set in request cleanup handler. This worked for HTTP/3 connections, but not for hq connections. Now keepalive timer is deleted in ngx_http_v3_init_request_stream() and set in connection cleanup handler, which works both for HTTP/3 and hq.
* QUIC: application init() callback.Roman Arutyunyan2022-11-30
| | | | | | | | | | It's called after handshake completion or prior to the first early data stream creation. The callback should initialize application-level data before creating streams. HTTP/3 callback implementation sets keepalive timer and sends SETTINGS. Also, this allows to limit max handshake time in ngx_http_v3_init_stream().
* HTTP/3: renamed functions.Roman Arutyunyan2022-08-22
| | | | | ngx_http_v3_init() is renamed ngx_http_v3_init_stream(). ngx_http_v3_reset_connection() is renamed to ngx_http_v3_reset_stream().
* QUIC: removed cancelable flag from QUIC and HTTP/3 events.Roman Arutyunyan2022-11-30
| | | | | | All these events are created in context of a client connection and are deleted when the connection is closed. Setting ev->cancelable could trigger premature connection closure and a socket leak alert.
* QUIC: idle mode for main connection.Roman Arutyunyan2022-10-19
| | | | | | | | | Now main QUIC connection for HTTP/3 always has c->idle flag set. This allows the connection to receive worker shutdown notification. It is passed to application level via a new conf->shutdown() callback. The HTTP/3 shutdown callback sends GOAWAY to client and gracefully shuts down the QUIC connection.
* HTTP/3: unified hq code with regular HTTP/3 code.Roman Arutyunyan2022-10-19
| | | | | The change removes hq-specific request handler. Now hq requests are handled by the HTTP/3 request handler.
* QUIC: reusable mode for main connection.Roman Arutyunyan2022-11-29
| | | | | | The connection is automatically switched to this mode by transport layer when there are no non-cancelable streams. Currently, cancelable streams are HTTP/3 encoder/decoder/control streams.
* HTTP/3: fixed build without NGX_PCRE (broken by 0f5fc7a320db).Jiuzhou Cui2022-11-25
|
* HTTP/3: fixed server_name regex captures (ticket #2407).Sergey Kandaurov2022-11-22
| | | | | | | Previously, HTTP/3 stream connection didn't inherit the servername regex from the main QUIC connection saved when processing SNI and using regular expressions in server names. As a result, it didn't execute to set regex captures when choosing the virtual server while parsing HTTP/3 headers.
* HTTP/3: skip empty request body buffers (ticket #2374).Roman Arutyunyan2022-08-03
| | | | | | | | | | | | When client DATA frame header and its content come in different QUIC packets, it may happen that only the header is processed by the first ngx_http_v3_request_body_filter() call. In this case an empty request body buffer is added to r->request_body->bufs, which is later reused in a subsequent ngx_http_v3_request_body_filter() call without being removed from the body chain. As a result, rb->request_body->bufs ends up with two copies of the same buffer. The fix is to avoid adding empty request body buffers to r->request_body->bufs.
* Merged with the default branch.Sergey Kandaurov2022-06-22
|
* HTTP/3: updated SETTINGS_MAX_FIELD_SECTION_SIZE name.Sergey Kandaurov2022-06-08
|
* HTTP/3: require that field section base index is not negative.Roman Arutyunyan2022-05-26
| | | | RFC 9204 explicitly requires that.
* QUIC: stream lingering.Roman Arutyunyan2022-02-05
| | | | | | | Now ngx_quic_stream_t is decoupled from ngx_connection_t in a way that it can persist after connection is closed by application. During this period, server is expecting stream final size from client for correct flow control. Also, buffered output is sent to client as more flow control credit is granted.
* HTTP/3: proper uni stream closure detection.Roman Arutyunyan2022-01-31
| | | | | | | | | | | | | | Previously, closure detection for server-initiated uni streams was not properly implemented. Instead, HTTP/3 code relied on QUIC code posting the read event and setting rev->error when it needed to close the stream. Then, regular uni stream read handler called c->recv() and received error, which closed the stream. This was an ad-hoc solution. If, for whatever reason, the read handler was called earlier, c->recv() would return 0, which would also close the stream. Now server-initiated uni streams have a separate read event handler for tracking stream closure. The handler calls c->recv(), which normally returns 0, but may return error in case of closure.
* HTTP/3: delayed Insert Count Increment instruction.Roman Arutyunyan2022-01-27
| | | | | | | | Sending the instruction is delayed until the end of the current event cycle. Delaying the instruction is allowed by quic-qpack-21, section 2.2.2.3. The goal is to reduce the amount of data sent back to client by accumulating several inserts in one instruction and sometimes not sending the instruction at all, if Section Acknowledgement was sent just before it.
* QUIC: allowed main QUIC connection for some operations.Roman Arutyunyan2022-01-31
| | | | | | | Operations like ngx_quic_open_stream(), ngx_http_quic_get_connection(), ngx_http_v3_finalize_connection(), ngx_http_v3_shutdown_connection() used to receive a QUIC stream connection. Now they can receive the main QUIC connection as well. This is useful when calling them from a stream context.
* HTTP/3: removed draft versions support in ALPN.Sergey Kandaurov2022-01-26
|
* QUIC: the "quic_active_connection_id_limit" directive.Vladimir Homutov2022-01-18
| | | | | The directive sets corresponding transport parameter and limits number of created client ids.
* HTTP/3: improved processing of multiple Cookie field lines.Sergey Kandaurov2021-12-30
| | | | | As per draft-ietf-quic-http, 4.1.1.2, and similar to HTTP/2 specification, they ought to be concatenated. This closely follows ngx_http_v2_module.
* Style.Roman Arutyunyan2021-12-29
|
* Merged with the default branch.Ruslan Ermilov2021-12-24
|
* HTTP/3: avoid sending stream cancellation for pushed streams.Sergey Kandaurov2021-12-07
|
* HTTP/3: renamed files.Roman Arutyunyan2021-12-07
| | | | | | | | ngx_http_v3_tables.h and ngx_http_v3_tables.c are renamed to ngx_http_v3_table.h and ngx_http_v3_table.c to better match HTTP/2 code. ngx_http_v3_streams.h and ngx_http_v3_streams.c are renamed to ngx_http_v3_uni.h and ngx_http_v3_uni.c to better match their content.
* QUIC: simplified configuration.Vladimir Homutov2021-12-06
| | | | | | | Directives that set transport parameters are removed from the configuration. Corresponding values are derived from the quic configuration or initialized to default. Whenever possible, quic configuration parameters are taken from higher-level protocol settings, i.e. HTTP/3.
* HTTP/3: $http3 variable.Roman Arutyunyan2021-12-01
| | | | | | | | | A new variable $http3 is added. The variable equals to "h3" for HTTP/3 connections, "hq" for hq connections and is an empty string otherwise. The variable $quic is eliminated. The new variable is similar to $http2 variable.