summaryrefslogtreecommitdiffhomepage
path: root/src/http/v3 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-04-22HTTP/3: adjusted control stream parsing.Vladimir Homutov1-0/+4
7.2.1: If a DATA frame is received on a control stream, the recipient MUST respond with a connection error of type H3_FRAME_UNEXPECTED; 7.2.2: If a HEADERS frame is received on a control stream, the recipient MUST respond with a connection error (Section 8) of type H3_FRAME_UNEXPECTED.
2021-04-16HTTP/3: keepalive_time support.Sergey Kandaurov2-4/+12
2021-04-12HTTP/3: removed h3scf->quic leftover after 0d2b2664b41c.Sergey Kandaurov1-1/+0
2021-03-15HTTP/3: fixed $connection_requests.Roman Arutyunyan1-0/+1
Previously, the value was always "1".
2021-03-30HTTP/3: keepalive timeout.Roman Arutyunyan3-0/+85
This timeout limits the time when no client request streams exist.
2021-03-15QUIC: connection shutdown.Roman Arutyunyan3-0/+10
The function ngx_quic_shutdown_connection() waits until all non-cancelable streams are closed, and then closes the connection. In HTTP/3 cancelable streams are all unidirectional streams except push streams. The function is called from HTTP/3 when client reaches keepalive_requests.
2021-03-15HTTP/3: send GOAWAY when last request is accepted.Roman Arutyunyan3-0/+56
The last request in connection is determined according to the keepalive_requests directive. Requests beyond keepalive_requests are rejected.
2021-03-16HTTP/3: do not push until a MAX_PUSH_ID frame is received.Sergey Kandaurov2-3/+6
Fixes interop with quic-go that doesn't send MAX_PUSH_ID.
2021-03-10HTTP/3: fixed server push.Sergey Kandaurov1-0/+1
2021-02-17HTTP/3: limited client header size.Roman Arutyunyan2-0/+16
The limit is the size of all large client header buffers. Client header size is the total size of all client header names and values.
2021-02-17HTTP/3: introduced ngx_http_v3_parse_t structure.Roman Arutyunyan2-19/+14
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.
2021-02-16HTTP/3: removed http3_max_field_size.Roman Arutyunyan3-19/+5
Instead, size of one large_client_header_buffers buffer is used.
2021-02-01HTTP/3: fixed format specifier.Roman Arutyunyan1-1/+1
2021-01-25HTTP/3: refactored request body parser.Roman Arutyunyan2-46/+461
The change reduces diff to the default branch for src/http/ngx_http_request_body.c. Also, client Content-Length, if present, is now checked against the real body size sent by client.
2021-01-29HTTP/3: call ngx_handle_read_event() from client header handler.Roman Arutyunyan1-4/+5
This function should be called at the end of an event handler to prepare the event for the next handler call. Particularly, the "active" flag is set or cleared depending on data availability. With this call missing in one code path, read handler was not called again after handling the initial part of the client request, if the request was too big to fit into a single STREAM frame. Now ngx_handle_read_event() is called in this code path. Also, read timer is restarted.
2021-01-18HTTP/3: client header validation.Roman Arutyunyan1-0/+70
A header with the name containing null, CR, LF, colon or uppercase characters, is now considered an error. A header with the value containing null, CR or LF, is also considered an error. Also, header is considered invalid unless its name only contains lowercase characters, digits, minus and optionally underscore. Such header can be optionally ignored.
2021-01-12HTTP/3: added comment.Roman Arutyunyan1-0/+1
2021-01-22HTTP/3: client pseudo-headers restrictions.Roman Arutyunyan1-0/+92
- :method, :path and :scheme are expected exactly once and not empty - :method and :scheme character validation is added - :authority cannot appear more than once
2021-01-22HTTP/3: refactored request parser.Roman Arutyunyan3-222/+378
The change reduces diff to the default branch for src/http/ngx_http_request.c and src/http/ngx_http_parse.c.
2020-12-16HTTP/3: staticize internal parsing functions.Sergey Kandaurov2-45/+45
2020-12-16HTTP/3: staticize ngx_http_v3_methods.Sergey Kandaurov1-1/+1
2020-11-27HTTP/3: introduced ngx_http_v3_filter.Roman Arutyunyan3-1135/+1360
The filter is responsible for creating HTTP/3 response header and body. The change removes differences to the default branch for ngx_http_chunked_filter_module and ngx_http_header_filter_module.
2020-11-25HTTP/3: eliminated r->method_start.Roman Arutyunyan1-8/+7
The field was introduced to ease parsing HTTP/3 requests. The change reduces diff to the default branch.
2020-11-17HTTP/3: null-terminate empty header value.Roman Arutyunyan1-0/+1
Header value returned from the HTTP parser is expected to be null-terminated or have a spare byte after the value bytes. When an empty header value was passed by client in a literal header representation, neither was true. This could result in segfault. The fix is to assign a literal empty null-terminated string in this case. Thanks to Andrey Kolyshkin.
2020-11-10QUIC: renamed c->qs to c->quic.Roman Arutyunyan5-24/+24
2020-11-10QUIC: multiple versions support in ALPN.Sergey Kandaurov1-3/+2
Previously, a version based on NGX_QUIC_DRAFT_VERSION was always set. Now it is taken from the negotiated QUIC version that may differ.
2020-09-16HTTP/3: rearranged length check when parsing header.Roman Arutyunyan1-5/+5
The new code looks simpler and is similar to other checks.
2020-09-16HTTP/3: reject HTTP/2 frames.Roman Arutyunyan1-0/+17
As per HTTP/3 draft 30, section 7.2.8: Frame types that were used in HTTP/2 where there is no corresponding HTTP/3 frame have also been reserved (Section 11.2.1). These frame types MUST NOT be sent, and their receipt MUST be treated as a connection error of type H3_FRAME_UNEXPECTED.
2020-08-24HTTP/3: skip unknown frames on request stream.Roman Arutyunyan3-11/+60
As per HTTP/3 draft 29, section 4.1: Frames of unknown types (Section 9), including reserved frames (Section 7.2.8) MAY be sent on a request or push stream before, after, or interleaved with other frames described in this section. Also, trailers frame is now used as an indication of the request body end.
2020-09-16HTTP/3: fixed handling request body eof.Roman Arutyunyan1-12/+12
While for HTTP/1 unexpected eof always means an error, for HTTP/3 an eof right after a DATA frame end means the end of the request body. For this reason, since adding HTTP/3 support, eof no longer produced an error right after recv() but was passed to filters which would make a decision. This decision was made in ngx_http_parse_chunked() and ngx_http_v3_parse_request_body() based on the b->last_buf flag. Now that since 0f7f1a509113 (1.19.2) rb->chunked->length is a lower threshold for the expected number of bytes, it can be set to zero to indicate that more bytes may or may not follow. Now it's possible to move the check for eof from parser functions to ngx_http_request_body_chunked_filter() and clean up the parsing code. Also, in the default branch, in case of eof, the following three things happened, which were replaced with returning NGX_ERROR while implementing HTTP/3: - "client prematurely closed connection" message was logged - c->error flag was set - NGX_HTTP_BAD_REQUEST was returned The change brings back this behavior for HTTP/1 as well as HTTP/3.
2020-08-31HTTP/3: do not set the never-indexed literal bit by default.Roman Arutyunyan1-3/+3
The "Literal Header Field Never Indexed" header field representation is not used in HTTP/2, and it makes little sense to make a distinction in HTTP/3.
2020-08-18HTTP/3: fixed context storage in request body parser.Sergey Kandaurov1-1/+1
2020-07-23HTTP/3: server pushes.Roman Arutyunyan5-11/+1018
New directives are added: - http3_max_concurrent_pushes - http3_push - http3_push_preload
2020-07-27QUIC: limited the number of server-initiated streams.Roman Arutyunyan1-13/+15
Also, ngx_quic_create_uni_stream() is replaced with ngx_quic_open_stream() which is capable of creating a bidi stream.
2020-07-14HTTP/3: support $server_protocol variable.Roman Arutyunyan1-0/+2
Now it holds "HTTP/3.0". Previously it was empty.
2020-07-23Style: moved function declarations to match usual code style.Roman Arutyunyan1-11/+9
Plus a few other minor style changes.
2020-07-23HTTP/3: renamed server configuration variables from v3cf to h3scf.Roman Arutyunyan4-26/+26
Now they are similar to HTTP/2 where they are called h2scf.
2020-07-13HTTP/3: renamed ngx_http_v3.c to ngx_http_v3_encode.c.Roman Arutyunyan1-0/+0
The file contains only encoding functions.
2020-07-13HTTP/3: encode frame ids with ngx_http_v3_encode_varlen_int().Roman Arutyunyan1-4/+8
Even though typically frame ids fit into a single byte, calling ngx_http_v3_encode_varlen_int() adds to the code clarity.
2020-07-23HTTP/3: generate Location response header for absolute redirects.Roman Arutyunyan1-2/+81
2020-07-13HTTP/3: header encoding functions.Roman Arutyunyan3-90/+226
2020-07-21QUIC: added "quic" listen parameter.Roman Arutyunyan3-253/+44
The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there
2020-07-20Fixed format specifiers.Sergey Kandaurov1-1/+1
2020-07-02HTTP/3: simplified handling return codes from parse functions.Roman Arutyunyan1-30/+4
2020-07-03HTTP/3: put ngx_http_v3_parse_varlen_int() return code in variable.Roman Arutyunyan1-16/+26
This makes calling this function similar to other parse functions.
2020-07-03HTTP/3: simplifed handling ngx_http_v3_parse_literal() return code.Roman Arutyunyan1-56/+21
2020-07-03HTTP/3: limited prefixed integer size by 62 bits.Roman Arutyunyan1-38/+66
2020-07-03HTTP/3: fixed overflow in prefixed integer parser.Roman Arutyunyan1-1/+1
Previously, the expression (ch & 0x7f) was promoted to a signed integer. Depending on the platform, the size of this integer could be less than 8 bytes, leading to overflow when handling the higher bits of the result. Also, sign bit of this integer could be replicated when adding to the 64-bit st->value.
2020-07-02HTTP/3: fixed prefix in decoding Section Acknowledgement.Sergey Kandaurov1-1/+1
2020-07-02HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.Roman Arutyunyan6-131/+213
Previously errors led only to closing streams. To simplify closing QUIC connection from a QUIC stream context, new macro ngx_http_v3_finalize_connection() is introduced. It calls ngx_quic_finalize_connection() for the parent connection.