]> granicus.if.org Git - apache/commitdiff
mod_http2: signalling produce IO before waiting on beam buffer to drain.
authorStefan Eissing <icing@apache.org>
Sun, 30 Jul 2017 18:54:15 +0000 (18:54 +0000)
committerStefan Eissing <icing@apache.org>
Sun, 30 Jul 2017 18:54:15 +0000 (18:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1803454 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_bucket_beam.c
modules/http2/h2_version.h

index fc2b723072e5cfbeb2a4db58388ad1f768d21e76..9f3bc709117589cdd2667eaa84a64e1f5eabf308 100644 (file)
@@ -367,7 +367,7 @@ static apr_status_t wait_not_empty(h2_bucket_beam *beam, apr_read_type_e block,
 }
 
 static apr_status_t wait_not_full(h2_bucket_beam *beam, apr_read_type_e block, 
-                                  apr_size_t *pspace_left, apr_thread_mutex_t *lock)
+                                  apr_size_t *pspace_left, h2_beam_lock *bl)
 {
     apr_status_t rv = APR_SUCCESS;
     apr_size_t left;
@@ -376,14 +376,16 @@ static apr_status_t wait_not_full(h2_bucket_beam *beam, apr_read_type_e block,
         if (beam->aborted) {
             rv = APR_ECONNABORTED;
         }
-        else if (block != APR_BLOCK_READ) {
+        else if (block != APR_BLOCK_READ || !bl->mutex) {
             rv = APR_EAGAIN;
         }
-        else if (beam->timeout > 0) {
-            rv = apr_thread_cond_timedwait(beam->change, lock, beam->timeout);
-        }
         else {
-            rv = apr_thread_cond_wait(beam->change, lock);
+            if (beam->timeout > 0) {
+                rv = apr_thread_cond_timedwait(beam->change, bl->mutex, beam->timeout);
+            }
+            else {
+                rv = apr_thread_cond_wait(beam->change, bl->mutex);
+            }
         }
     }
     *pspace_left = left;
@@ -944,7 +946,8 @@ apr_status_t h2_beam_send(h2_bucket_beam *beam,
             space_left = calc_space_left(beam);
             while (!APR_BRIGADE_EMPTY(sender_bb) && APR_SUCCESS == rv) {
                 if (space_left <= 0) {
-                    rv = wait_not_full(beam, block, &space_left, bl.mutex);
+                    report_prod_io(beam, force_report, &bl);
+                    rv = wait_not_full(beam, block, &space_left, &bl);
                     if (APR_SUCCESS != rv) {
                         break;
                     }
index 0fdb26395f640c4b15b01342a6a5815b5e5ce68b..ac029bbe6b5e4cc1ef82c4e5bd2e30fa968fba64 100644 (file)
@@ -26,7 +26,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.10.9-DEV"
+#define MOD_HTTP2_VERSION "1.10.10-DEV"
 
 /**
  * @macro
@@ -34,7 +34,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 0x010a09
+#define MOD_HTTP2_VERSION_NUM 0x010a0a
 
 
 #endif /* mod_h2_h2_version_h */