Commit Graph

17 Commits

Author SHA1 Message Date
Roman Arutyunyan eea23ac250 HTTP/3: "quic" parameter of "listen" directive.
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.
2023-02-27 14:00:56 +04:00
Roman Arutyunyan aa58c6457a QUIC: application init() callback.
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().
2022-11-30 12:51:15 +04:00
Roman Arutyunyan 1ff821f800 QUIC: removed cancelable flag from QUIC and HTTP/3 events.
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.
2022-11-30 14:09:08 +04:00
Roman Arutyunyan 7cccd64670 HTTP/3: unified hq code with regular HTTP/3 code.
The change removes hq-specific request handler.  Now hq requests are handled
by the HTTP/3 request handler.
2022-10-19 17:45:30 +04:00
Roman Arutyunyan 6850f6e935 HTTP/3: delayed Insert Count Increment instruction.
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.
2022-01-27 12:20:47 +03:00
Roman Arutyunyan d503544196 QUIC: allowed main QUIC connection for some operations.
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.
2022-01-31 09:16:47 +03:00
Roman Arutyunyan 261439aed2 HTTP/3: adjusted QUIC connection finalization.
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-18 15:22:33 +03:00
Roman Arutyunyan 6fe2069e12 HTTP/3: traffic-based flood detection.
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-07 13:22:42 +03:00
Roman Arutyunyan a3b881bf6c HTTP/3: client GOAWAY support. 2021-06-11 13:24:24 +03:00
Roman Arutyunyan c0766c7e56 HTTP/3: clean up table from session cleanup handler.
Previously table had a separate cleanup handler.
2021-04-28 11:30:27 +03:00
Roman Arutyunyan c79e86564d HTTP/3: moved session initialization to a separate file.
Previously it was in ngx_http_v3_streams.c, but it's unrelated to streams.
2021-05-05 15:15:48 +03:00
Roman Arutyunyan 9d47ea2ffc HTTP/3: renamed ngx_http_v3.c to ngx_http_v3_encode.c.
The file contains only encoding functions.
2020-07-13 12:38:08 +03:00
Roman Arutyunyan 459fd8e589 HTTP/3: header encoding functions. 2020-07-13 16:00:00 +03:00
Roman Arutyunyan 902358052c HTTP/3: fixed prefixed integer encoding and decoding.
Previously bytes were ordered from MSB to LSB, but the right order is the
reverse.
2020-07-02 15:15:55 +03:00
Roman Arutyunyan f5497fb4b2 HTTP/3: fixed encoding variable-length integers. 2020-04-21 17:11:49 +03:00
Roman Arutyunyan 08a6458386 Refactored HTTP/3 parser. 2020-03-18 13:46:35 +03:00
Roman Arutyunyan 0159e05a1e HTTP/3. 2020-03-13 19:36:33 +03:00