[PATCH] Stream: allow waiting on a blocked QUIC stream (ticket #2479)
Sergey Kandaurov
pluknet at nginx.com
Thu Apr 6 16:17:07 UTC 2023
> On 6 Apr 2023, at 15:41, Roman Arutyunyan <arut at nginx.com> wrote:
>
> # HG changeset patch
> # User Roman Arutyunyan <arut at nginx.com>
> # Date 1680781188 -14400
> # Thu Apr 06 15:39:48 2023 +0400
> # Branch quic
> # Node ID 078d2beff084108a10b6b0549d1696561cdee141
> # Parent f68fdb01714121017a91a60370c074e59b730239
> Stream: allow waiting on a blocked QUIC stream (ticket #2479).
>
> Previously, waiting on a shared connection was not allowed, because the only
> type of such connection was plain UDP. However, QUIC stream connections are
> also shared since they share socket descriptor with the listen connection.
> Meanwhile, it's perfectly normal to wait on such connections.
>
> The issue manifested itself with stream write errors when the amount of data
> exceeded stream buffer size or flow control. Now no error is triggered
> and Stream write module is allowed to wait for buffer space to become available.
>
> diff --git a/src/stream/ngx_stream_write_filter_module.c b/src/stream/ngx_stream_write_filter_module.c
> --- a/src/stream/ngx_stream_write_filter_module.c
> +++ b/src/stream/ngx_stream_write_filter_module.c
> @@ -277,7 +277,12 @@ ngx_stream_write_filter(ngx_stream_sessi
> *out = chain;
>
> if (chain) {
> - if (c->shared) {
> + if (c->shared
> +#if (NGX_STREAM_QUIC)
> + && c->quic == NULL
> +#endif
> + )
> + {
> ngx_log_error(NGX_LOG_ALERT, c->log, 0,
> "shared connection is busy");
> return NGX_ERROR;
Looks good.
--
Sergey Kandaurov
More information about the nginx-devel
mailing list