]> granicus.if.org Git - apache/commitdiff
mod_http2: adding defensive code for stream EOS handling, in case the request handler
authorStefan Eissing <icing@apache.org>
Wed, 10 Oct 2018 11:35:48 +0000 (11:35 +0000)
committerStefan Eissing <icing@apache.org>
Wed, 10 Oct 2018 11:35:48 +0000 (11:35 +0000)
     missed to signal it the normal way (eos buckets). Addresses github issues
     https://github.com/icing/mod_h2/issues/164, https://github.com/icing/mod_h2/issues/167
     and https://github.com/icing/mod_h2/issues/170.

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

CHANGES
modules/http2/h2_session.c
modules/http2/h2_stream.c
modules/http2/h2_version.h

diff --git a/CHANGES b/CHANGES
index ac9d47a46c647898e897b46199284ef1b8a20ed7..47c9d3cf1397024287cdbbbff674ee1de6b4942a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_http2: adding defensive code for stream EOS handling, in case the request handler
+     missed to signal it the normal way (eos buckets). Addresses github issues 
+     https://github.com/icing/mod_h2/issues/164, https://github.com/icing/mod_h2/issues/167
+     and https://github.com/icing/mod_h2/issues/170. [Stefan Eissing] 
+
   *) mod_proxy_scgi, mod_proxy_uwsgi: improve error handling when sending the
      body of the response. [Jim Jagielski]
 
index a67a0ef05f8f46df82bd73cd758464357ea579b6..df2c8c9b9eda66de4cfebd2026369c624eb9c261 100644 (file)
@@ -1097,6 +1097,10 @@ static ssize_t stream_data_cb(nghttp2_session *ng2s,
         case APR_SUCCESS:
             break;
             
+        case APR_EOF:
+            eos = 1;
+            break;
+            
         case APR_ECONNRESET:
         case APR_ECONNABORTED:
             return NGHTTP2_ERR_CALLBACK_FAILURE;
index 22c59024444290a403e131b7aff66e8f0d05307c..24ebc56023d8024e16bca5a8182fd62c63a4aff9 100644 (file)
@@ -919,7 +919,7 @@ apr_status_t h2_stream_out_prepare(h2_stream *stream, apr_off_t *plen,
                           (long)*plen, *peos);
         }
         else {
-            status = APR_EAGAIN;
+            status = (stream->output && h2_beam_is_closed(stream->output))? APR_EOF : APR_EAGAIN;
             ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c,
                           H2_STRM_MSG(stream, "prepare, no data"));
         }
index c88982e1da6ba215d0e72a0508c59f12fad206ce..bdfdba5015acd3031c40c3b3cb0a23e229f44e59 100644 (file)
@@ -27,7 +27,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.11.2-DEV"
+#define MOD_HTTP2_VERSION "1.11.3-DEV"
 
 /**
  * @macro
@@ -35,7 +35,7 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define MOD_HTTP2_VERSION_NUM 0x010b02
+#define MOD_HTTP2_VERSION_NUM 0x010b03
 
 
 #endif /* mod_h2_h2_version_h */