aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | | | | | | | | HTTP/3: set c->error on read error in ngx_http_test_reading().Roman Arutyunyan2022-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to other error/eof cases.
| * | | | | | | | | HTTP/3: simplified code.Roman Arutyunyan2022-01-12
| | | | | | | | | |
| * | | | | | | | | QUIC: modified HTTP version test.Roman Arutyunyan2022-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new condition produces smaller diff to the default branch and is similar to HTTP/2 case.
| * | | | | | | | | 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.Sergey Kandaurov2021-12-29
| |\ \ \ \ \ \ \ \ \
| * | | | | | | | | | QUIC: got rid of ngx_quic_create_temp_socket().Vladimir Homutov2021-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was mostly copy of the ngx_quic_listen(). Now ngx_quic_listen() no longer generates server id and increments seqnum. Instead, the server id is generated when the socket is created. The ngx_quic_alloc_socket() function is renamed to ngx_quic_create_socket().
| * | | | | | | | | | Fixed a mismerge in 5c86189a1c1b.Ruslan Ermilov2021-12-28
| | | | | | | | | | |
| * | | | | | | | | | QUIC: renamed input handling functions.Roman Arutyunyan2021-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now these functions have names ngx_quic_handle_XXX(): - ngx_quic_process_stateless_reset() -> ngx_quic_handle_stateless_reset() - ngx_quic_input() -> ngx_quic_handle_datagram() - ngx_quic_process_packet() -> ngx_quic_handle_packet() - ngx_quic_process_payload() -> ngx_quic_handle_payload()
| * | | | | | | | | | QUIC: fixed format specifier after 6ccf3867959a.Roman Arutyunyan2021-12-28
| | | | | | | | | | |
| * | | | | | | | | | QUIC: fixed config test with bpf (ticket #2292).Vladimir Homutov2021-12-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SO_REUSEPORT socket option is not set during configuration testing, thus making the further module initialization impossible and meaningless.
| * | | | | | | | | | QUIC: refactored buffer allocation, spliting and freeing.Roman Arutyunyan2021-12-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, buffer lists was used to track used buffers. Now reference counter is used instead. The new implementation is simpler and faster with many buffer clones.
| * | | | | | | | | | QUIC: removed ngx_quic_copy_chain().Roman Arutyunyan2021-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function is unused.
| * | | | | | | | | | QUIC: renamed buffer-related functions.Roman Arutyunyan2021-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ngx_quic_alloc_buf() -> ngx_quic_alloc_chain(), ngx_quic_free_bufs() -> ngx_quic_free_chain(), ngx_quic_trim_bufs() -> ngx_quic_trim_chain()
| * | | | | | | | | | QUIC: refactored ngx_quic_order_bufs() and ngx_quic_split_bufs().Roman Arutyunyan2021-12-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are replaced with ngx_quic_write_chain() and ngx_quic_read_chain(). These functions represent the API to data buffering. The first function adds data of given size at given offset to the buffer. Now it returns the unwritten part of the chain similar to c->send_chain(). The second function returns data of given size from the beginning of the buffer. Its second argument and return value are swapped compared to ngx_quic_split_bufs() to better match ngx_quic_write_chain(). Added, returned and stored data are regular ngx_chain_t/ngx_buf_t chains. Missing data is marked with b->sync flag. The functions are now used in both send and recv data chains in QUIC streams.
| * | | | | | | | | | QUIC: avoid excessive buffer allocations in stream output.Roman Arutyunyan2021-12-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when a few bytes were send to a QUIC stream by the application, a 4K buffer was allocated for these bytes. Then a STREAM frame was created and that entire buffer was used as data for that frame. The frame with the buffer were in use up until the frame was acked by client. Meanwhile, when more bytes were send to the stream, more buffers were allocated and assigned as data to newer STREAM frames. In this scenario most buffer memory is unused. Now the unused part of the stream output buffer is available for further stream output while earlier parts of the buffer are waiting to be acked. This is achieved by splitting the output buffer.
| * | | | | | | | | | QUIC: got rid of excessive "qsock" argument in ngx_quic_output.c.Vladimir Homutov2021-12-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output is always sent to the active path, which is stored in the quic connection. There is no need to pass it in arguments. When output has to be send to to a specific path (in rare cases, such as path probing), a separate method exists (ngx_quic_frame_sendto()).
| * | | | | | | | | | QUIC: refactored ngx_quic_validate_path().Vladimir Homutov2021-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function now accepts path argument, as suggested by the name. Socket is not really needed inside.
| * | | | | | | | | | QUIC: added missing check for backup path existence.Vladimir Homutov2021-12-16
| | | | | | | | | | |
| * | | | | | | | | | Merged with the default branch.Ruslan Ermilov2021-12-24
| |\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | QUIC: added path limiting function ngx_quic_path_limit().Roman Arutyunyan2021-12-14
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: decoupled path state and limitation status.Vladimir Homutov2021-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The path validation status and anti-amplification limit status is actually two different variables. It is possible that validating path should not be limited (for example, when re-validating former path).
| * | | | | | | | | | | QUIC: improved path validation.Vladimir Homutov2021-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, path was considered valid during arbitrary selected 10m timeout since validation. This is quite not what RFC 9000 says; the relevant part is: An endpoint MAY skip validation of a peer address if that address has been seen recently. The patch considers a path to be 'recently seen' if packets were received during idle timeout. If a packet is received from the path that was seen not so recently, such path is considered new, and anti-amplification restrictions apply.
| * | | | | | | | | | | QUIC: write and full stream shutdown support.Roman Arutyunyan2021-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Full stream shutdown is now called from stream cleanup handler instead of explicitly sending frames.
| * | | | | | | | | | | QUIC: simplified stream initialization.Roman Arutyunyan2021-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After creation, a client stream is added to qc->streams.uninitialized queue. After initialization it's removed from the queue. If a stream is never initialized, it is freed in ngx_quic_close_streams(). Stream initializer is now set as read event handler in stream connection. Previously qc->streams.uninitialized was used only for delayed stream initialization. The change makes it possible not to handle separately the case of a new stream in stream-related frame handlers. It makes these handlers simpler since new streams and existing streams are now handled by the same code.
| * | | | | | | | | | | QUIC: post stream events instead of calling their handlers.Roman Arutyunyan2021-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This potentially reduces the number of handler calls.
| * | | | | | | | | | | QUIC: added missing frame initialization.Vladimir Homutov2021-12-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, all used fields are initialized, but usage may change in future.
| * | | | | | | | | | | QUIC: refactored ngx_quic_frame_sendto() function.Vladimir Homutov2021-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function now takes path as an argument to deal with associated restrictions and update sent counter.
| * | | | | | | | | | | QUIC: fixed e06283038ec8 mis-merge.Sergey Kandaurov2021-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NGX_HTTP_QUIC macro was removed in 33226ac61076.
| * | | | | | | | | | | HTTP/3: cleanup after "listen .. quic" removal in be08b858086a.Sergey Kandaurov2021-12-08
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: clear SSL_OP_ENABLE_MIDDLEBOX_COMPAT on SSL context switch.Sergey Kandaurov2021-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SSL_OP_ENABLE_MIDDLEBOX_COMPAT option is provided by QuicTLS and enabled by default in the newly created SSL contexts. SSL_set_quic_method() is used to clear it, which is required for SSL handshake to work on QUIC connections. Switching context in the ngx_http_ssl_servername() SNI callback overrides SSL options from the new SSL context. This results in the option set again. Fix is to explicitly clear it when switching to another SSL context. Initially reported here (in Russian): http://mailman.nginx.org/pipermail/nginx-ru/2021-November/063989.html
| * | | | | | | | | | | HTTP/3: avoid sending stream cancellation for pushed streams.Sergey Kandaurov2021-12-07
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: converted ngx_quic_keys_set_encryption_secret() to NGX codes.Sergey Kandaurov2021-12-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While here, removed check for encryption level zero, redundant by its nature.
| * | | | | | | | | | | 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.
| * | | | | | | | | | | HTTP/3: http3_hq directive and NGX_HTTP_V3_HQ macro.Roman Arutyunyan2021-12-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Listen quic parameter is no longer supported.
| * | | | | | | | | | | HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.Roman Arutyunyan2021-12-06
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: fixed using of retired connection id (ticket #2289).Vladimir Homutov2021-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 9000 19.16 The sequence number specified in a RETIRE_CONNECTION_ID frame MUST NOT refer to the Destination Connection ID field of the packet in which the frame is contained. Before the patch, the RETIRE_CONNECTION_ID frame was sent before switching to the new client id. If retired client id was currently in use, this lead to violation of the spec.
| * | | | | | | | | | | QUIC: logging of CRYPTO frame payload under NGX_QUIC_DEBUG_FRAMES.Sergey Kandaurov2021-12-02
| | | | | | | | | | | |
| * | | | | | | | | | | HTTP/3: adjusted ALPN macro names to align with 61abb35bb8cf.Sergey Kandaurov2021-12-02
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: removed excessive check.Vladimir Homutov2021-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The c->udp->dgram may be NULL only if the quic connection was just created: the ngx_event_udp_recvmsg() passes information about datagrams to existing connections by providing information in c->udp. If case of a new connection, c->udp is allocated by the QUIC code during creation of quic connection (it uses c->sockaddr to initialize qsock->path). Thus the check for qsock->path is excessive and can be read wrong, assuming that other options possible, leading to warnings from clang static analyzer.
| * | | | | | | | | | | QUIC: ngx_quic_send_alert() callback moved to its place.Sergey Kandaurov2021-11-30
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: simplified ngx_quic_send_alert() callback.Sergey Kandaurov2021-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed sending CLOSE_CONNECTION directly to avoid duplicate frames, since it is sent later again in SSL_do_handshake() error handling. As such, removed redundant settings of error fields set elsewhere. While here, improved debug message.
| * | | | | | | | | | | QUIC: removed unnecessary closing of active/backup sockets.Vladimir Homutov2021-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All open sockets are stored in a queue. There is no need to close some of them separately. If it happens that active and backup point to same socket, double close may happen (leading to possible segfault).
| * | | | | | | | | | | QUIC: fixed migration during NAT rebinding.Vladimir Homutov2021-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RFC 9000 allows a packet from known CID arrive from unknown path: These requirements regarding connection ID reuse apply only to the sending of packets, as unintentional changes in path without a change in connection ID are possible. For example, after a period of network inactivity, NAT rebinding might cause packets to be sent on a new path when the client resumes sending. Before the patch, such packets were rejected with an error in the ngx_quic_check_migration() function. Removing the check makes the separate function excessive - remaining checks are early migration check and "disable_active_migration" check. The latter is a transport parameter sent to client and it should not be used by server. The server should send "disable_active_migration" "if the endpoint does not support active connection migration" (18.2). The support status depends on nginx configuration: to have migration working with multiple workers, you need bpf helper, available on recent Linux systems. The patch does not set "disable_active_migration" automatically and leaves it for the administrator. By default, active migration is enabled. RFC 900 says that it is ok to migrate if the peer violates "disable_active_migration" flag requirements: If the peer violates this requirement, the endpoint MUST either drop the incoming packets on that path without generating a Stateless Reset OR proceed with path validation and allow the peer to migrate. Generating a Stateless Reset or closing the connection would allow third parties in the network to cause connections to close by spoofing or otherwise manipulating observed traffic. So, nginx adheres to the second option and proceeds to path validation. Note: The ngtcp2 may be used for testing both active migration and NAT rebinding: ngtcp2/client --change-local-addr=200ms --delay-stream=500ms <ip> <port> <url> ngtcp2/client --change-local-addr=200ms --delay-stream=500ms --nat-rebinding \ <ip> <port> <url>
| * | | | | | | | | | | QUIC: refactored multiple QUIC packets handling.Vladimir Homutov2021-11-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Single UDP datagram may contain multiple QUIC datagrams. In order to facilitate handling of such cases, 'first' flag in the ngx_quic_header_t structure is introduced.
| * | | | | | | | | | | QUIC: fixed handling of RETIRE_CONNECTION_ID frame.Vladimir Homutov2021-11-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the retired socket was not closed if it didn't match active or backup. New sockets could not be created (due to count limit), since retired socket was not closed before calling ngx_quic_create_sockets(). When replacing retired socket, new socket is only requested after closing old one, to avoid hitting the limit on the number of active connection ids. Together with added restrictions, this fixes an issue when a current socket could be closed during migration, recreated and erroneously reused leading to null pointer dereference.
| * | | | | | | | | | | QUIC: additional checks for the RETIRE_CONNECTION_ID frame.Vladimir Homutov2021-11-18
| | | | | | | | | | | |
| * | | | | | | | | | | QUIC: handle DATA_BLOCKED frame from client.Roman Arutyunyan2021-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the frame was not handled and connection was closed with an error. Now, after receiving this frame, global flow control is updated and new flow control credit is sent to client.