aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
...
| * | | | QUIC: treat qc->error == -1 as a missing error.Roman Arutyunyan2022-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, zero was used for this purpose. However, NGX_QUIC_ERR_NO_ERROR is zero too. As a result, NGX_QUIC_ERR_NO_ERROR was changed to NGX_QUIC_ERR_INTERNAL_ERROR when closing a QUIC connection.
| * | | | QUIC: fixed computation of nonce with packet numbers beyond 2^32.Sergey Kandaurov2022-11-25
| | | | | | | | | | | | | | | | | | | | Prodded by Yu Zhu.
| * | | | HTTP/3: fixed build without NGX_PCRE (broken by 0f5fc7a320db).Jiuzhou Cui2022-11-25
| | | | |
| * | | | QUIC: fixed triggering stream read event (ticket #2409).Roman Arutyunyan2022-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a client packet carrying a stream data frame is not acked due to packet loss, the stream data is retransmitted later by client. It's also possible that the retransmitted range is bigger than before due to more stream data being available by then. If the original data was read out by the application, there would be no read event triggered by the retransmitted frame, even though it contains new data.
| * | | | QUIC: fixed C4334 MSVC warning about 32 to 64 bits conversion.Sergey Kandaurov2022-11-22
| | | | |
| * | | | QUIC: plug MSVC warning about potentially uninitialized variable.Sergey Kandaurov2022-11-22
| | | | |
| * | | | Added shutdown macros for win32 required for QUIC.Sergey Kandaurov2022-11-22
| | | | |
| * | | | QUIC: fixed C4389 MSVC warning about signed/unsigned mismatch.Sergey Kandaurov2022-11-22
| | | | |
| * | | | QUIC: avoid using C99 designated initializers.Sergey Kandaurov2022-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They are not supported by MSVC till 2012. SSL_QUIC_METHOD initialization is moved to run-time to preserve portability among SSL library implementations, which allows to reduce its visibility. Note using of a static storage to keep SSL_set_quic_method() reference valid.
| * | | | QUIC: moved variable declaration to fix build with MSVC 2010.Sergey Kandaurov2022-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, ngx_quic_hkdf_t variables used declaration with assignment in the middle of a function, which is not supported by MSVC 2010. Fixing this also required to rewrite the ngx_quic_hkdf_set macro and to switch to an explicit array size.
| * | | | QUIC: fixed C4706 warnings with MSVC 2010.Sergey Kandaurov2022-11-22
| | | | | | | | | | | | | | | | | | | | The fix is to avoid assignments within conditional expression.
| * | | | HTTP/3: fixed server_name regex captures (ticket #2407).Sergey Kandaurov2022-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, HTTP/3 stream connection didn't inherit the servername regex from the main QUIC connection saved when processing SNI and using regular expressions in server names. As a result, it didn't execute to set regex captures when choosing the virtual server while parsing HTTP/3 headers.
| * | | | Set default listen socket type in http.Roman Arutyunyan2022-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type field was added in 7999d3fbb765 at early stages of QUIC implementation and was not initialized for default listen. Missing initialization resulted in default listen socket creation error.
| * | | | Merged with the default branch.Sergey Kandaurov2022-10-20
| |\ \ \ \
| * | | | | QUIC: removed compatibility with older BoringSSL API.Sergey Kandaurov2022-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL_CIPHER_get_protocol_id() appeared in BoringSSL somewhere between BORINGSSL_API_VERSION 12 and 13 for compatibility with OpenSSL 1.1.1. It was adopted without a proper macro test, which remained unnoticed. This justifies that such old BoringSSL API isn't widely used and its support can be dropped. While here, removed SSL_set_quic_use_legacy_codepoint() that became useless after the default was flipped in BoringSSL over a year ago.
| * | | | | QUIC: support for setting QUIC methods with LibreSSL.Sergey Kandaurov2022-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting QUIC methods is converted to use C99 designated initializers for simplicity, as LibreSSL 3.6.0 has different SSL_QUIC_METHOD layout. Additionally, only set_read_secret/set_write_secret callbacks are set. Although they are preferred in LibreSSL over set_encryption_secrets, better be on a safe side as LibreSSL has unexpectedly incompatible set_encryption_secrets calling convention expressed in passing read and write secrets split in separate calls, unlike this is documented in old BoringSSL sources. To avoid introducing further changes for the old API, it is simply disabled.
| * | | | | QUIC: using SSL_set_quic_early_data_enabled() only with QuicTLS.Sergey Kandaurov2022-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This function is present in QuicTLS only. After SSL_READ_EARLY_DATA_SUCCESS became visible in LibreSSL together with experimental QUIC API, this required to revise the conditional compilation test to use more narrow macros.
| * | | | | QUIC: using native TLSv1.3 cipher suite constants.Sergey Kandaurov2022-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After BoringSSL aligned[1] with OpenSSL on TLS1_3_CK_* macros, and LibreSSL uses OpenSSL naming, our own variants can be dropped now. Compatibility is preserved with libraries that lack these macros. Additionally, transition to SSL_CIPHER_get_id() fixes build error with LibreSSL that doesn't implement SSL_CIPHER_get_protocol_id(). [1] https://boringssl.googlesource.com/boringssl/+/dfddbc4ded
| * | | | | QUIC: "info" logging level on insufficient client connection ids.Sergey Kandaurov2022-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, this error is reported on NAT rebinding if client didn't previously send NEW_CONNECTION_ID to supply additional connection ids.
| * | | | | HTTP/3: skip empty request body buffers (ticket #2374).Roman Arutyunyan2022-08-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When client DATA frame header and its content come in different QUIC packets, it may happen that only the header is processed by the first ngx_http_v3_request_body_filter() call. In this case an empty request body buffer is added to r->request_body->bufs, which is later reused in a subsequent ngx_http_v3_request_body_filter() call without being removed from the body chain. As a result, rb->request_body->bufs ends up with two copies of the same buffer. The fix is to avoid adding empty request body buffers to r->request_body->bufs.
| * | | | | QUIC: avoided pool usage in token calculation.Vladimir Homutov2022-05-31
| | | | | |
| * | | | | QUIC: removed ngx_quic_keys_new().Vladimir Homutov2022-07-27
| | | | | | | | | | | | | | | | | | | | | | | | The ngx_quic_keys_t structure is now exposed.
| * | | | | QUIC: avoided pool usage in ngx_quic_protection.c.Vladimir Homutov2022-07-27
| | | | | |
| * | | | | QUIC: fixed-length buffers for secrets.Vladimir Homutov2022-07-27
| | | | | |
| * | | | | Merged with the default branch.Sergey Kandaurov2022-07-26
| |\ \ \ \ \
| * \ \ \ \ \ Merged with the default branch.Sergey Kandaurov2022-06-22
| |\ \ \ \ \ \
| * | | | | | | HTTP/3: updated SETTINGS_MAX_FIELD_SECTION_SIZE name.Sergey Kandaurov2022-06-08
| | | | | | | |
| * | | | | | | HTTP/3: require that field section base index is not negative.Roman Arutyunyan2022-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC 9204 explicitly requires that.
| * | | | | | | QUIC: separate UDP framework for QUIC.Roman Arutyunyan2022-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, QUIC used the existing UDP framework, which was created for UDP in Stream. However the way QUIC connections are created and looked up is different from the way UDP connections in Stream are created and looked up. Now these two implementations are decoupled.
| * | | | | | | QUIC: fixed insertion at the end of buffer.Roman Arutyunyan2022-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, last buffer was tracked by keeping a pointer to the previous chain link "next" field. When the previous buffer was split and then removed, the pointer was no longer valid. Writing at this pointer resulted in broken data chains. Now last buffer is tracked by keeping a direct pointer to it.
| * | | | | | | 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).