]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_http2: fixed a bug in flushing pending data on an already closed
authorStefan Eissing <icing@apache.org>
Fri, 9 Jun 2023 15:02:21 +0000 (15:02 +0000)
committerStefan Eissing <icing@apache.org>
Fri, 9 Jun 2023 15:02:21 +0000 (15:02 +0000)
     connection that could lead to a busy loop, preventing the HTTP/2 session
     to close down successfully. Fixed PR 66624.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910331 13f79535-47bb-0310-9956-ffa450edef68

changes-entries/h2_flush_fix.txt [new file with mode: 0644]
modules/http2/h2_session.c

diff --git a/changes-entries/h2_flush_fix.txt b/changes-entries/h2_flush_fix.txt
new file mode 100644 (file)
index 0000000..b44a331
--- /dev/null
@@ -0,0 +1,4 @@
+  *) mod_http2: fixed a bug in flushing pending data on an already closed
+     connection that could lead to a busy loop, preventing the HTTP/2 session
+     to close down successfully. Fixed PR 66624.
+     [Stefan Eissing]
index 0ede886998f1b1f2045b064ad5344dc547ee5ecd..1f37a36bf72fd50c1f01d4fbbc23b653b55eccc2 100644 (file)
@@ -1281,8 +1281,11 @@ static apr_status_t h2_session_send(h2_session *session)
                 goto cleanup;
             }
         }
-        if (h2_c1_io_needs_flush(&session->io)) {
+        if (h2_c1_io_needs_flush(&session->io) ||
+            ngrv == NGHTTP2_ERR_WOULDBLOCK) {
             rv = h2_c1_io_assure_flushed(&session->io);
+            if (rv != APR_SUCCESS)
+                goto cleanup;
             pending = 0;
         }
     }