]> git.kaiwu.me - nginx.git/commitdiff
Stream: allow waiting on a blocked QUIC stream (ticket #2479).
authorRoman Arutyunyan <arut@nginx.com>
Thu, 6 Apr 2023 11:39:48 +0000 (15:39 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 6 Apr 2023 11:39:48 +0000 (15:39 +0400)
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.

src/stream/ngx_stream_write_filter_module.c

index 07dc7b52e394dcd8ba2bce000d77ad2cdd811afc..d8a72f966d4afbd37d188e237ef2a81bfbb10027 100644 (file)
@@ -277,7 +277,12 @@ ngx_stream_write_filter(ngx_stream_session_t *s, ngx_chain_t *in,
     *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;