aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | | | | | | QUIC: fixed indentation.Sergey Kandaurov2022-02-16
| | | | | | | |
| * | | | | | | QUIC: optimize insertion at the end of QUIC buffer.Roman Arutyunyan2022-02-14
| | | | | | | |
| * | | | | | | QUIC: eliminated ngx_quic_copy_buf().Roman Arutyunyan2022-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its only call is substituted with QUIC buffer write/read pair.
| * | | | | | | QUIC: trim input chain in ngx_quic_buffer_write().Roman Arutyunyan2022-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to eliminate explicit trimming when handling input STREAM frame. As a result, ngx_quic_trim_chain() is eliminated as well.
| * | | | | | | QUIC: ngx_quic_buffer_t object.Roman Arutyunyan2022-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The object is used instead of ngx_chain_t pointer for buffer operations like ngx_quic_write_chain() and ngx_quic_read_chain(). These functions are renamed to ngx_quic_write_buffer() and ngx_quic_read_buffer().
| * | | | | | | QUIC: stream lingering.Roman Arutyunyan2022-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ngx_quic_stream_t is decoupled from ngx_connection_t in a way that it can persist after connection is closed by application. During this period, server is expecting stream final size from client for correct flow control. Also, buffered output is sent to client as more flow control credit is granted.
| * | | | | | | QUIC: optimized datagram expansion with half-RTT tickets.Sergey Kandaurov2022-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As shown in RFC 8446, section 2.2, Figure 3, and further specified in section 4.6.1, BoringSSL releases session tickets in Application Data (along with Finished) early, based on a precalculated client Finished transcript, once client signalled early data in extensions.
| * | | | | | | Merged with the default branch.Sergey Kandaurov2022-02-14
| |\ \ \ \ \ \ \
| * | | | | | | | QUIC: fixed in-flight bytes accounting.Vladimir Homutov2022-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initially, frames are genereated and stored in ctx->frames. Next, ngx_quic_output() collects frames to be sent in in ctx->sending. On failure, ngx_quic_revert_sned() returns frames into ctx->frames. On success, the ngx_quic_commit_send() moves ack-eliciting frames into ctx->sent and frees non-ack-eliciting frames. This function also updates in-flight bytes counter, so only actually sent frames are accounted. The counter is decremented in the following cases: - acknowledgment is received - packet was declared lost - we are discarding context completely In each of this cases frame is removed from ctx->sent queue and in-flight counter is accordingly decremented. The patch fixes the case of discarding context - only removing frames from ctx->sent must be followed by in-flight bytes counter decrement, otherwise cg->in_flight could experience type underflow. The issue appeared in b1676cd64dc9.
| * | | | | | | | QUIC: fixed output context restoring.Vladimir Homutov2022-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cd8018bc81a5 fixed unintended send of non-padded initial packets, but failed to restore context properly: only processed contexts need to be restored. As a consequence, a packet number could be restored from uninitialized value.
| * | | | | | | | QUIC: fixed resetting stream wev->ready flag.Roman Arutyunyan2022-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the flag could be reset after send_chain() with a limit, even though there was room for more data. The application then started waiting for a write event notification, which never happened. Now the wev->ready flag is only reset when flow control is exhausted.
| * | | | | | | | QUIC: fixed the "quic_stream_buffer_size" directive.Vladimir Homutov2022-02-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default value is now correctly set and the configuration is properly merged.
| * | | | | | | | QUIC: switch stream to DATA_RECVD state.Roman Arutyunyan2022-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The switch happens when received byte counter reaches stream final size. Previously, this state was skipped. The stream went from SIZE_KNOWN to DATA_READ when all bytes were read by application. The change prevents STOP_SENDING frames from being sent when all data is received from client, but not yet fully read by application.
| * | | | | | | | QUIC: improved size calculation in ngx_quic_write_chain().Roman Arutyunyan2022-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, size was calculated based on the number of input bytes processed by the function. Now only the copied bytes are considered. This prevents overlapping buffers from contributing twice to the overall written size.
| * | | | | | | | QUIC: do not arm loss detection timer if nothing was sent.Sergey Kandaurov2022-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notably, this became quite practicable after the recent fix in cd8018bc81a5. Additionally, do not arm loss detection timer on connection termination.
| * | | | | | | | QUIC: fixed padding of initial packets in case of limited path.Vladimir Homutov2022-02-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, non-padded initial packet could be sent as a result of the following situation: - initial queue is not empty (so padding to 1200 is required) - handshake queue is not empty (so padding is to be added after h/s packet) - path is limited If serializing handshake packet would violate path limit, such packet was omitted, and the non-padded initial packet was sent. The fix is to avoid sending the packet at all in such case. This follows the original intention introduced in c5155a0cb12f.
| * | | | | | | | QUIC: do not declare SSL buffering, it's not used.Sergey Kandaurov2022-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No functional changes.
| * | | | | | | | QUIC: improved debug logging.Vladimir Homutov2022-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - wording in log->action is adjusted to match function names. - connection close steps are made obvious and start with "quic close" prefix: *1 quic close initiated rc:-4 *1 quic close silent drain:0 timedout:1 *1 quic close resumed rc:-1 *1 quic close resumed rc:-1 *1 quic close resumed rc:-4 *1 quic close completed this makes it easy to understand if particular "close" record is an initial cause or lasting process, or the final one. - cases of close without quic connection now logged as "packet rejected": *14 quic run *14 quic packet rx long flags:ec version:1 *14 quic packet rx hs len:61 *14 quic packet rx dcid len:20 00000000000002c32f60e4aa2b90a64a39dc4228 *14 quic packet rx scid len:8 81190308612cd019 *14 quic expected initial, got handshake *14 quic packet done rc:-1 level:hs decr:0 pn:0 perr:0 *14 quic packet rejected rc:-1, cleanup connection *14 reusable connection: 0 this makes it easy to spot early packet rejection and avoid confuse with quic connection closing (which in fact was not even created). - packet processing summary now uses same prefix "quic packet done rc:" - added debug to places where packet was rejected without any reason logged
| * | | | | | | | QUIC: got rid of hash symbol in backup and logging.Vladimir Homutov2022-01-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now all objectes with sequence number (i.e. sockets, connection ids and paths) are logged as "foo seq:N".
| * | | | | | | | QUIC: dead code removed.Vladimir Homutov2022-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ngx_quic_parse_packet() now returns NGX_OK, NGX_ERROR (parsing failed) and NGX_ABORT (unsupported version).
| * | | | | | | | QUIC: merged ngx_quic_close_quic() and ngx_quic_close_connection().Vladimir Homutov2022-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The separate ngx_quic_close_quic() doesn't make much sense.
| * | | | | | | | QUIC: revised ngx_quic_handle_datagram() error codes.Vladimir Homutov2022-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NGX_DECLINED is replaced with NGX_DONE to match closer to return code of ngx_quic_handle_packet() and ngx_quic_close_connection() rc argument. The ngx_quic_close_connection() rc code is used only when quic connection exists, thus anything goes if qc == NULL. The ngx_quic_handle_datagram() does not return NG_OK in cases when quic connection is not yet created.
| * | | | | | | | QUIC: stream event setting function.Roman Arutyunyan2022-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function ngx_quic_set_event() is now called instead of posting events directly.
| * | | | | | | | QUIC: style.Roman Arutyunyan2022-01-31
| | | | | | | | |
| * | | | | | | | HTTP/3: proper uni stream closure detection.Roman Arutyunyan2022-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, closure detection for server-initiated uni streams was not properly implemented. Instead, HTTP/3 code relied on QUIC code posting the read event and setting rev->error when it needed to close the stream. Then, regular uni stream read handler called c->recv() and received error, which closed the stream. This was an ad-hoc solution. If, for whatever reason, the read handler was called earlier, c->recv() would return 0, which would also close the stream. Now server-initiated uni streams have a separate read event handler for tracking stream closure. The handler calls c->recv(), which normally returns 0, but may return error in case of closure.
| * | | | | | | | QUIC: introduced explicit stream states.Roman Arutyunyan2022-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to eliminate the usage of stream connection event flags for tracking stream state.
| * | | | | | | | HTTP/3: delayed Insert Count Increment instruction.Roman Arutyunyan2022-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | QUIC: allowed main QUIC connection for some operations.Roman Arutyunyan2022-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | | | QUIC: limited SSL_set_quic_use_legacy_codepoint() API usage.Sergey Kandaurov2022-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As advertised in BoringSSL a1d3bfb64fd7ef2cb178b5b515522ffd75d7b8c5, it may be dropped once callers implementing the draft versions cycle out.
| * | | | | | | | QUIC: style.Roman Arutyunyan2022-01-26
| | | | | | | | |
| * | | | | | | | QUIC: fixed handling of initial source connection id.Vladimir Homutov2022-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was broken in 1e2f4e9c8195. While there, adjusted formatting of debug message with socket seqnum.
| * | | | | | | | QUIC: set to standard TLS codepoint after draft versions removal.Sergey Kandaurov2022-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is to ease transition with oldish BoringSSL versions, the default for SSL_set_quic_use_legacy_codepoint() has been flipped in BoringSSL a1d3bfb64fd7ef2cb178b5b515522ffd75d7b8c5.
| * | | | | | | | QUIC: removed draft versions support.Sergey Kandaurov2022-01-26
| | | | | | | | |
| * | | | | | | | HTTP/3: removed draft versions support in ALPN.Sergey Kandaurov2022-01-26
| | | | | | | | |
| * | | | | | | | QUIC: changed debug message.Roman Arutyunyan2022-01-21
| | | | | | | | |
| * | | | | | | | Merged with the default branch.Sergey Kandaurov2022-01-25
| |\ \ \ \ \ \ \ \
| * | | | | | | | | QUIC: fixed macro style.Vladimir Homutov2022-01-25
| | | | | | | | | |
| * | | | | | | | | QUIC: fixed chain returned from ngx_quic_write_chain().Roman Arutyunyan2022-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when input ended on a QUIC buffer boundary, input chain was not advanced to the next buffer. As a result, ngx_quic_write_chain() returned a chain with an empty buffer instead of NULL. This broke HTTP write filter, preventing it from closing the HTTP request and eventually timing out. Now input chain is always advanced to a buffer that has data, before checking QUIC buffer boundary condition.
| * | | | | | | | | QUIC: removed stale declaration.Vladimir Homutov2022-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ngx_quic_get_unconnected_socket() was removed in 1e2f4e9c8195.
| * | | | | | | | | QUIC: avoid logging error in case of version negotiation.Vladimir Homutov2022-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, "early error" message was logged in this case.
| * | | | | | | | | QUIC: additional limit for probing packets.Vladimir Homutov2022-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 9000, 9.3. Responding to Connection Migration: An endpoint only changes the address to which it sends packets in response to the highest-numbered non-probing packet. The patch extends this requirement to probing packets. Although it may seem excessive, it helps with mitigation of reply attacks (when an off-path attacker has copied packet with PATH_CHALLENGE and uses different addresses to exhaust available connection ids).
| * | | | | | | | | QUIC: reworked migration handling.Vladimir Homutov2022-01-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The quic connection now holds active, backup and probe paths instead of sockets. The number of migration paths is now limited and cannot be inflated by a bad client or an attacker. The client id is now associated with path rather than socket. This allows to simplify processing of output and connection ids handling. New migration abandons any previously started migrations. This allows to free consumed client ids and request new for use in future migrations and make progress in case when connection id limit is hit during migration. A path now can be revalidated without losing its state. The patch also fixes various issues with NAT rebinding case handling: - paths are now validated (previously, there was no validation and paths were left in limited state) - attempt to reuse id on different path is now again verified (this was broken in 40445fc7c403) - former path is now validated in case of apparent migration
| * | | | | | | | | QUIC: the "quic_active_connection_id_limit" directive.Vladimir Homutov2022-01-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The directive sets corresponding transport parameter and limits number of created client ids.
| * | | | | | | | | QUIC: introduced function ngx_quic_split_chain().Roman Arutyunyan2022-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function splits a buffer at given offset. The function is now called from ngx_quic_read_chain() and ngx_quic_write_chain(), which simplifies both functions.
| * | | | | | | | | QUIC: fixed format specifier after 3789f4a56d65.Roman Arutyunyan2022-01-16
| | | | | | | | | |
| * | | | | | | | | QUIC: return written size from ngx_quic_write_chain().Roman Arutyunyan2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to escape calculating it before calling the function.
| * | | | | | | | | QUIC: removed ngx_send_lowat() check for QUIC connections.Sergey Kandaurov2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 9ae239d2547d, ngx_quic_handle_write_event() no longer runs into ngx_send_lowat() for QUIC connections, so the check became excessive. It is assumed that external modules operating with SO_SNDLOWAT (I'm not aware of any) should do this check on their own.
| * | | | | | | | | HTTP/3: removed useless warning regarding OpenSSL library.Sergey Kandaurov2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After 0e6528551f26, it became impossible to run into this path.
| * | | | | | | | | QUIC: fixed handling stream input buffers.Roman Arutyunyan2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, ngx_quic_write_chain() treated each input buffer as a memory buffer, which is not always the case. Special buffers were not skipped, which is especially important when hitting the input byte limit. The issue manifested itself with ngx_quic_write_chain() returning a non-empty chain consisting of a special last_buf buffer when called from QUIC stream send_chain(). In order for this to happen, input byte limit should be equal to the chain length, and the input chain should end with an empty last_buf buffer. An easy way to achieve this is the following: location /empty { return 200; } When this non-empty chain was returned from send_chain(), it signalled to the caller that input was blocked, while in fact it wasn't. This prevented HTTP request from finalization, which prevented QUIC from sending STREAM FIN to the client. The QUIC stream was then reset after a timeout. Now special buffers are skipped and send_chain() returns NULL in the case above, which signals to the caller a successful operation. Also, original byte limit is now passed to ngx_quic_write_chain() from send_chain() instead of actual chain length to make sure it's never zero.
| * | | | | | | | | QUIC: fixed handling STREAM FIN.Roman Arutyunyan2022-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when a STREAM FIN frame with no data bytes was received after all prior stream data were already read by the application layer, the frame was ignored and eof was not reported to the application.