summaryrefslogtreecommitdiffhomepage
path: root/src/http/v3 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-12-04HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.Roman Arutyunyan3-11/+36
Listen quic parameter is no longer supported.
2021-12-06HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.Roman Arutyunyan3-8/+556
2021-12-02HTTP/3: adjusted ALPN macro names to align with 61abb35bb8cf.Sergey Kandaurov1-1/+1
2021-10-18HTTP/3: send Stream Cancellation instruction.Roman Arutyunyan1-0/+8
As per quic-qpack-21: When a stream is reset or reading is abandoned, the decoder emits a Stream Cancellation instruction. Previously the instruction was not sent. Now it's sent when closing QUIC stream connection if dynamic table capacity is non-zero and eof was not received from client. The latter condition means that a trailers section may still be on its way from client and the stream needs to be cancelled.
2021-10-18HTTP/3: allowed QUIC stream connection reuse.Roman Arutyunyan3-23/+142
A QUIC stream connection is treated as reusable until first bytes of request arrive, which is also when the request object is now allocated. A connection closed as a result of draining, is reset with the error code H3_REQUEST_REJECTED. Such behavior is allowed by quic-http-34: Once a request stream has been opened, the request MAY be cancelled by either endpoint. Clients cancel requests if the response is no longer of interest; servers cancel requests if they are unable to or choose not to respond. When the server cancels a request without performing any application processing, the request is considered "rejected." The server SHOULD abort its response stream with the error code H3_REQUEST_REJECTED. The client can treat requests rejected by the server as though they had never been sent at all, thereby allowing them to be retried later.
2021-10-18HTTP/3: adjusted QUIC connection finalization.Roman Arutyunyan4-30/+82
When an HTTP/3 function returns an error in context of a QUIC stream, it's this function's responsibility now to finalize the entire QUIC connection with the right code, if required. Previously, QUIC connection finalization could be done both outside and inside such functions. The new rule follows a similar rule for logging, leads to cleaner code, and allows to provide more details about the error. While here, a few error cases are no longer treated as fatal and QUIC connection is no longer finalized in these cases. A few other cases now lead to stream reset instead of connection finalization.
2021-10-07HTTP/3: traffic-based flood detection.Roman Arutyunyan5-23/+138
With this patch, all traffic over HTTP/3 bidi and uni streams is counted in the h3c->total_bytes field, and payload traffic is counted in the h3c->payload_bytes field. As long as total traffic is many times larger than payload traffic, we consider this to be a flood. Request header traffic is counted as if all fields are literal. Response header traffic is counted as is.
2021-10-06HTTP/3: fixed request length calculation.Roman Arutyunyan1-2/+2
Previously, when request was blocked, r->request_length was not updated.
2021-10-06HTTP/3: removed client-side encoder support.Roman Arutyunyan2-156/+0
Dynamic tables are not used when generating responses anyway.
2021-09-27HTTP/3: fixed server push after ea9b645472b5.Sergey Kandaurov1-1/+1
Unlike in HTTP/2, both "host" and ":authority" reside in r->headers_in.server.
2021-09-22HTTP/3: fixed null pointer dereference with server push.Sergey Kandaurov1-0/+4
See details for HTTP/2 fix in 8b0553239592 for a complete description.
2021-09-22HTTP/3: fixed ngx_stat_active counter.Roman Arutyunyan2-0/+8
Previously the counter was not incremented for HTTP/3 streams, but still decremented in ngx_http_close_connection(). There are two solutions here, one is to increment the counter for HTTP/3 streams, and the other one is not to decrement the counter for HTTP/3 streams. The latter solution looks inconsistent with ngx_stat_reading/ngx_stat_writing, which are incremented on a per-request basis. The change adds ngx_stat_active increment for HTTP/3 request and push streams.
2021-09-17HTTP/3: fixed pushed request finalization in case of error.Roman Arutyunyan1-32/+23
Previously request could be finalized twice. For example, this could happen if "Host" header was invalid.
2021-09-17HTTP/3: make ngx_http_log_error() static again.Roman Arutyunyan1-1/+1
This function was only referenced from ngx_http_v3_create_push_request() to initialize push connection log. Now the log handler is copied from the parent request connection. The change reduces diff to the default branch.
2021-09-16HTTP/3: added CONNECT and TRACE methods rejection.Sergey Kandaurov1-1/+14
It has got lost in e1eb7f4ca9f1, let alone a subsequent update in 63c66b7cc07c.
2021-09-13HTTP/3: added debug logging of response fields.Sergey Kandaurov1-3/+38
Because of QPACK compression it's hard to see what fields are actually sent by the server.
2021-09-13HTTP/3: Huffman encoding for the Location response field.Sergey Kandaurov1-59/+55
2021-09-13HTTP/3: Huffman encoding for the Last-Modified response field.Sergey Kandaurov1-4/+11
2021-09-13HTTP/3: Huffman encoding for the Content-Type response field.Sergey Kandaurov1-20/+20
2021-09-13HTTP/3: implemented QPACK Huffman encoding for response fields.Sergey Kandaurov1-5/+82
2021-09-09HTTP/3: reading body buffering in filters.Roman Arutyunyan1-3/+35
This change follows similar changes in HTTP/1 and HTTP/2 in 9cf043a5d9ca.
2021-07-08HTTP/3: bulk parse functions.Roman Arutyunyan4-870/+1068
Previously HTTP/3 streams were parsed by one character. Now all parse functions receive buffers. This should optimize parsing time and CPU load.
2021-08-24HTTP/3: fixed dead store assignment.Sergey Kandaurov1-1/+0
Found by Clang Static Analyzer.
2021-08-10HTTP/3: disabled control characters and space in header names.Sergey Kandaurov1-1/+1
This is a follow up to 41f4bd4c51f1.
2021-08-04HTTP/3: replaced macros with values.Roman Arutyunyan2-13/+4
2021-07-29HTTP/3: close connection on keepalive_requests * 2.Roman Arutyunyan1-2/+9
After receiving GOAWAY, client is not supposed to create new streams. However, until client reads this frame, we allow it to create new streams, which are gracefully rejected. To prevent client from abusing this algorithm, a new limit is introduced. Upon reaching keepalive_requests * 2, server now closes the entire QUIC connection claiming excessive load.
2021-07-29HTTP/3: http3_max_uni_streams directive.Roman Arutyunyan3-0/+28
The directive limits the number of uni streams client is allowed to create.
2021-07-29HTTP/3: require mandatory uni streams before additional ones.Roman Arutyunyan1-2/+11
As per quic-http-34: Endpoints SHOULD create the HTTP control stream as well as the unidirectional streams required by mandatory extensions (such as the QPACK encoder and decoder streams) first, and then create additional streams as allowed by their peer. Previously, client could create and destroy additional uni streams unlimited number of times before creating mandatory streams.
2021-07-16HTTP/3: use request pool instead of connection pool.Roman Arutyunyan1-5/+5
In several parts of ngx_http_v3_header_filter() connection pool was used for request-related data.
2021-07-13HTTP/3: response trailers support.Roman Arutyunyan1-16/+118
2021-07-01HTTP/3: quic-qpack term updates.Sergey Kandaurov10-232/+232
Renamed header -> field per quic-qpack naming convention, in particular: - Header Field -> Field Line - Header Block -> (Encoded) Field Section - Without Name Reference -> With Literal Name - Header Acknowledgement -> Section Acknowledgment
2021-06-11HTTP/3: client GOAWAY support.Roman Arutyunyan6-0/+49
2021-06-11HTTP/3: generate more H3_FRAME_UNEXPECTED.Roman Arutyunyan1-3/+23
As per quic-http-34, these are the cases when this error should be generated: If an endpoint receives a second SETTINGS frame on the control stream, the endpoint MUST respond with a connection error of type H3_FRAME_UNEXPECTED SETTINGS frames MUST NOT be sent on any stream other than the control stream. If an endpoint receives a SETTINGS frame on a different stream, the endpoint MUST respond with a connection error of type H3_FRAME_UNEXPECTED. A client MUST NOT send a PUSH_PROMISE frame. A server MUST treat the receipt of a PUSH_PROMISE frame as a connection error of type H3_FRAME_UNEXPECTED; see Section 8. The MAX_PUSH_ID frame is always sent on the control stream. Receipt of a MAX_PUSH_ID frame on any other stream MUST be treated as a connection error of type H3_FRAME_UNEXPECTED. Receipt of an invalid sequence of frames MUST be treated as a connection error of type H3_FRAME_UNEXPECTED; see Section 8. In particular, a DATA frame before any HEADERS frame, or a HEADERS or DATA frame after the trailing HEADERS frame, is considered invalid. A CANCEL_PUSH frame is sent on the control stream. Receiving a CANCEL_PUSH frame on a stream other than the control stream MUST be treated as a connection error of type H3_FRAME_UNEXPECTED. The GOAWAY frame is always sent on the control stream.
2021-06-11HTTP/3: reordered H3_MISSING_SETTINGS and H3_FRAME_UNEXPECTED.Roman Arutyunyan1-6/+6
The quic-http-34 is ambiguous as to what error should be generated for the first frame in control stream: Each side MUST initiate a single control stream at the beginning of the connection and send its SETTINGS frame as the first frame on this stream. If the first frame of the control stream is any other frame type, this MUST be treated as a connection error of type H3_MISSING_SETTINGS. If a DATA frame is received on a control stream, the recipient MUST respond with a connection error of type H3_FRAME_UNEXPECTED. If a HEADERS frame is received on a control stream, the recipient MUST respond with a connection error of type H3_FRAME_UNEXPECTED. Previously, H3_FRAME_UNEXPECTED had priority, but now H3_MISSING_SETTINGS has. The arguments in the spec sound more compelling for H3_MISSING_SETTINGS.
2021-06-01HTTP/3: undo 5a92523e50d3 after parser refactoring (e1eb7f4ca9f1).Sergey Kandaurov1-1/+0
This is no longer needed after HTTP/3 request processing has moved into its own function ngx_http_v3_process_header().
2021-06-01HTTP/3: fixed parsing encoder insertions with empty header value.Sergey Kandaurov1-0/+2
When starting processing a new encoder instruction, the header state is not memzero'ed because generally it's burdensome. If the header value is empty, this resulted in inserting a stale value left from the previous instruction. Based on a patch by Zhiyong Sun.
2021-05-31HTTP/3: removed $http3 that served its purpose.Sergey Kandaurov1-50/+1
To specify final protocol version by hand: add_header Alt-Svc h3=":443";
2021-05-27HTTP/3: fixed Insert With Name Reference index processing.Sergey Kandaurov1-1/+12
Based on a patch by Zhiyong Sun.
2021-05-18HTTP/3: fixed server push after 9ec3e71f8a61.Roman Arutyunyan1-4/+3
When using server push, a segfault occured because ngx_http_v3_create_push_request() accessed ngx_http_v3_session_t object the old way. Prior to 9ec3e71f8a61, HTTP/3 session was stored directly in c->data. Now it's referenced by the v3_session field of ngx_http_connection_t.
2021-04-28HTTP/3: clean up table from session cleanup handler.Roman Arutyunyan3-19/+13
Previously table had a separate cleanup handler.
2021-05-05HTTP/3: moved session initialization to a separate file.Roman Arutyunyan3-75/+87
Previously it was in ngx_http_v3_streams.c, but it's unrelated to streams.
2021-05-05HTTP/3: separate header files for existing source files.Roman Arutyunyan4-74/+135
2021-05-05HTTP/3: moved parsing uni stream type to ngx_http_v3_parse.c.Roman Arutyunyan4-125/+159
Previously it was parsed in ngx_http_v3_streams.c, while the streams were parsed in ngx_http_v3_parse.c. Now all parsing is done in one file. This simplifies parsing API and cleans up ngx_http_v3_streams.c.
2021-04-27HTTP/3: renamed ngx_http_v3_client_XXX() functions.Roman Arutyunyan4-17/+16
The functions are renamed to ngx_http_v3_send_XXX() similar to ngx_http_v3_send_settings() and ngx_http_v3_send_goaway().
2021-05-05HTTP/3: renamed ngx_http_v3_connection_t to ngx_http_v3_session_t.Roman Arutyunyan5-38/+38
2021-05-05HTTP/3: reference h3c directly from ngx_http_connection_t.Roman Arutyunyan3-30/+19
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.
2021-04-30HTTP/3: ngx_http_v3_get_session() macro.Roman Arutyunyan5-22/+24
It's used instead of accessing c->quic->parent->data directly. Apart from being simpler, it allows to change the way session is stored in the future by changing the macro.
2021-05-05HTTP/3: moved Stream Cancellation stub to ngx_http_v3_streams.c.Roman Arutyunyan2-12/+12
2021-05-04HTTP/3: fixed decoder stream stubs.Roman Arutyunyan1-5/+5
Now ngx_http_v3_ack_header() and ngx_http_v3_inc_insert_count() always generate decoder error. Our implementation does not use dynamic tables and does not expect client to send Section Acknowledgement or Insert Count Increment. Stream Cancellation, on the other hand, is allowed to be sent anyway. This is why ngx_http_v3_cancel_stream() does not return an error.
2021-05-05HTTP/3: reject empty DATA and HEADERS frames on control stream.Roman Arutyunyan1-5/+4
Previously only non-empty frames were rejected.