summaryrefslogtreecommitdiffhomepage
path: root/src/http/v3/ngx_http_v3_streams.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2021-12-07HTTP/3: renamed files.Roman Arutyunyan1-733/+0
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.
2021-12-06QUIC: simplified configuration.Vladimir Homutov1-4/+1
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.
2021-10-18HTTP/3: allowed QUIC stream connection reuse.Roman Arutyunyan1-6/+11
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 Arutyunyan1-15/+64
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 Arutyunyan1-13/+47
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: removed client-side encoder support.Roman Arutyunyan1-149/+0
Dynamic tables are not used when generating responses anyway.
2021-07-08HTTP/3: bulk parse functions.Roman Arutyunyan1-16/+19
Previously HTTP/3 streams were parsed by one character. Now all parse functions receive buffers. This should optimize parsing time and CPU load.
2021-07-29HTTP/3: http3_max_uni_streams directive.Roman Arutyunyan1-0/+14
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-01HTTP/3: quic-qpack term updates.Sergey Kandaurov1-2/+2
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 Arutyunyan1-0/+15
2021-05-05HTTP/3: moved session initialization to a separate file.Roman Arutyunyan1-75/+1
Previously it was in ngx_http_v3_streams.c, but it's unrelated to streams.
2021-05-05HTTP/3: moved parsing uni stream type to ngx_http_v3_parse.c.Roman Arutyunyan1-106/+37
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 Arutyunyan1-8/+7
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 Arutyunyan1-17/+17
2021-05-05HTTP/3: reference h3c directly from ngx_http_connection_t.Roman Arutyunyan1-14/+9
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 Arutyunyan1-7/+7
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 Arutyunyan1-0/+12
2021-03-30HTTP/3: keepalive timeout.Roman Arutyunyan1-0/+41
This timeout limits the time when no client request streams exist.
2021-03-15QUIC: connection shutdown.Roman Arutyunyan1-0/+4
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 Arutyunyan1-0/+34
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 Kandaurov1-1/+2
Fixes interop with quic-go that doesn't send MAX_PUSH_ID.
2021-01-22HTTP/3: refactored request parser.Roman Arutyunyan1-36/+30
The change reduces diff to the default branch for src/http/ngx_http_request.c and src/http/ngx_http_parse.c.
2020-11-10QUIC: renamed c->qs to c->quic.Roman Arutyunyan1-9/+9
2020-07-23HTTP/3: server pushes.Roman Arutyunyan1-0/+135
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-23HTTP/3: renamed server configuration variables from v3cf to h3scf.Roman Arutyunyan1-6/+6
Now they are similar to HTTP/2 where they are called h2scf.
2020-07-21QUIC: added "quic" listen parameter.Roman Arutyunyan1-7/+42
The parameter allows processing HTTP/0.9-2 over QUIC. Also, introduced ngx_http_quic_module and moved QUIC settings there
2020-07-02HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.Roman Arutyunyan1-14/+44
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.
2020-07-02HTTP/3: refactored dynamic table implementation.Roman Arutyunyan1-4/+50
Previously dynamic table was not functional because of zero limit on its size set by default. Now the following changes enable it: - new directives to set SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS - send settings with SETTINGS_QPACK_MAX_TABLE_CAPACITY and SETTINGS_QPACK_BLOCKED_STREAMS to the client - send Insert Count Increment to the client - send Header Acknowledgement to the client - evict old dynamic table entries on overflow - decode Required Insert Count from client - block stream if Required Insert Count is not reached
2020-05-19HTTP/3: prevent array access by negative index for unknown streams.Roman Arutyunyan1-1/+3
Currently there are no such streams, but the function ngx_http_v3_get_uni_stream() supports them.
2020-04-23Assign connection number to every QUIC stream log.Roman Arutyunyan1-2/+0
2020-03-25Simplifed handling HTTP/3 streams.Roman Arutyunyan1-168/+77
2020-03-24When closing a QUIC connection, wait for all streams to finish.Roman Arutyunyan1-0/+21
Additionally, streams are now removed from the tree in cleanup handler.
2020-03-18Fixed HTTP/3 server stream creation.Roman Arutyunyan1-5/+5
2020-03-18Refactored HTTP/3 parser.Roman Arutyunyan1-574/+118
2020-03-13HTTP/3.Roman Arutyunyan1-0/+1097