You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2023/06/09 15:02:22 UTC

svn commit: r1910331 - in /httpd/httpd/trunk: changes-entries/h2_flush_fix.txt modules/http2/h2_session.c

Author: icing
Date: Fri Jun  9 15:02:21 2023
New Revision: 1910331

URL: http://svn.apache.org/viewvc?rev=1910331&view=rev
Log:
  *) 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.


Added:
    httpd/httpd/trunk/changes-entries/h2_flush_fix.txt
Modified:
    httpd/httpd/trunk/modules/http2/h2_session.c

Added: httpd/httpd/trunk/changes-entries/h2_flush_fix.txt
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/changes-entries/h2_flush_fix.txt?rev=1910331&view=auto
==============================================================================
--- httpd/httpd/trunk/changes-entries/h2_flush_fix.txt (added)
+++ httpd/httpd/trunk/changes-entries/h2_flush_fix.txt Fri Jun  9 15:02:21 2023
@@ -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]

Modified: httpd/httpd/trunk/modules/http2/h2_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_session.c?rev=1910331&r1=1910330&r2=1910331&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_session.c Fri Jun  9 15:02:21 2023
@@ -1281,8 +1281,11 @@ static apr_status_t h2_session_send(h2_s
                 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;
         }
     }