Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] QUIC: defer setting the active flag for client stream events

Roman Arutyunyan
January 17, 2023 05:46AM
> On 16 Jan 2023, at 17:27, Sergey Kandaurov <pluknet@nginx.com> wrote:
>
> # HG changeset patch
> # User Sergey Kandaurov <pluknet@nginx.com>
> # Date 1673875616 -14400
> # Mon Jan 16 17:26:56 2023 +0400
> # Branch quic
> # Node ID f7c7cabe232898db5b16a142163de71964cebcfd
> # Parent 6bb884dc72916dc675df65d02abee0c9cfabc916
> QUIC: defer setting the active flag for client stream events.
>
> Specifically, now it is kept unset until streams are initialized.
> Notably, this unbreaks OCSP with client certificates after 35e27117b593.
> Previously, the read event could be posted prematurely in ngx_quic_set_event()
> e.g., as part of handling a STREAM frame.
>
> diff --git a/src/event/quic/ngx_event_quic_streams.c b/src/event/quic/ngx_event_quic_streams.c
> --- a/src/event/quic/ngx_event_quic_streams.c
> +++ b/src/event/quic/ngx_event_quic_streams.c
> @@ -106,6 +106,13 @@ ngx_quic_open_stream(ngx_connection_t *c
> return NULL;
> }
>
> + nqs->connection->write->active = 1;
> + nqs->connection->write->ready = 1;
> +
> + if (!bidi) {

if (bidi) ?

> + nqs->connection->read->active = 1;
> + }
> +
> return nqs->connection;

This could've been simplified by adding a variable for nqs->connection, YMMV.

> }
>
> @@ -534,6 +541,13 @@ ngx_quic_init_stream_handler(ngx_event_t
>
> ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "quic init stream");
>
> + if ((qs->id & NGX_QUIC_STREAM_UNIDIRECTIONAL) == 0) {
> + c->write->active = 1;
> + c->write->ready = 1;
> + }
> +
> + c->read->active = 1;
> +
> ngx_queue_remove(&qs->queue);
>
> c->listening->handler(c);
> @@ -704,19 +718,6 @@ ngx_quic_create_stream(ngx_connection_t
>
> log->connection = sc->number;
>
> - if ((id & NGX_QUIC_STREAM_UNIDIRECTIONAL) == 0
> - || (id & NGX_QUIC_STREAM_SERVER_INITIATED))
> - {
> - sc->write->active = 1;
> - sc->write->ready = 1;
> - }
> -
> - if ((id & NGX_QUIC_STREAM_UNIDIRECTIONAL) == 0
> - || (id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0)
> - {
> - sc->read->active = 1;
> - }
> -
> if (id & NGX_QUIC_STREAM_UNIDIRECTIONAL) {
> if (id & NGX_QUIC_STREAM_SERVER_INITIATED) {
> qs->send_max_data = qc->ctp.initial_max_stream_data_uni;
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> https://mailman.nginx.org/mailman/listinfo/nginx-devel


----
Roman Arutyunyan
arut@nginx.com




_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] QUIC: defer setting the active flag for client stream events

Sergey Kandaurov 389 January 16, 2023 08:28AM

Re: [PATCH] QUIC: defer setting the active flag for client stream events

Roman Arutyunyan 98 January 17, 2023 05:46AM

Re: [PATCH] QUIC: defer setting the active flag for client stream events

Sergey Kandaurov 103 January 17, 2023 07:02AM

Re: [PATCH] QUIC: defer setting the active flag for client stream events

Roman Arutyunyan 191 January 17, 2023 07:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 286
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready