On the trunk:
authorStefan Eissing <icing@apache.org>
Tue, 30 Jan 2018 10:09:36 +0000 (10:09 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 30 Jan 2018 10:09:36 +0000 (10:09 +0000)
mod_http2: removed obsolete stream detach code, no longer generating events
     in beam shutdown on pool destroy.

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

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

diff --git a/CHANGES b/CHANGES
index 79f3b8d0e5756747658685d2c2915fb58d5bd81c..0f1e92c3f5c0e2689ad85e3d5282564062f2192a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_http2: removed obsolete stream detach code, no longer generating events
+     in beam shutdown on pool destroy. [Stefan Eissing]
+     
   *) mod_slotmem_shm: Rework SHM reuse/deletion to fix races with graceful
      restarts. PR 62044. [Yann Ylavic, Jim Jagielski]
 
index 33439b8fdeb04f1cd55dfdecda2ab9b0500c4508..6b6750d1fa17eab440a58175b697f894b03d283b 100644 (file)
@@ -556,9 +556,8 @@ static void recv_buffer_cleanup(h2_bucket_beam *beam, h2_beam_lock *bl)
     }
 }
 
-static apr_status_t beam_cleanup(void *data)
+static apr_status_t beam_cleanup(h2_bucket_beam *beam, int from_pool)
 {
-    h2_bucket_beam *beam = data;
     apr_status_t status = APR_SUCCESS;
     int safe_send = (beam->owner == H2_BEAM_OWNER_SEND);
     int safe_recv = (beam->owner == H2_BEAM_OWNER_RECV);
@@ -571,6 +570,11 @@ static apr_status_t beam_cleanup(void *data)
      * Clean up receiver first, if safe, then cleanup sender, if safe.
      */
      
+     /* When called from pool destroy, io callbacks are disabled */
+     if (from_pool) {
+         beam->cons_io_cb = NULL;
+     }
+     
     /* When modify send is not safe, this means we still have multi-thread
      * protection and the owner is receiving the buckets. If the sending
      * side has not gone away, this means we could have dangling buckets
@@ -606,10 +610,15 @@ static apr_status_t beam_cleanup(void *data)
     return status;
 }
 
+static apr_status_t beam_pool_cleanup(void *data)
+{
+    return beam_cleanup(data, 1);
+}
+
 apr_status_t h2_beam_destroy(h2_bucket_beam *beam)
 {
-    apr_pool_cleanup_kill(beam->pool, beam, beam_cleanup);
-    return beam_cleanup(beam);
+    apr_pool_cleanup_kill(beam->pool, beam, beam_pool_cleanup);
+    return beam_cleanup(beam, 0);
 }
 
 apr_status_t h2_beam_create(h2_bucket_beam **pbeam, apr_pool_t *pool, 
@@ -642,7 +651,7 @@ apr_status_t h2_beam_create(h2_bucket_beam **pbeam, apr_pool_t *pool,
     if (APR_SUCCESS == rv) {
         rv = apr_thread_cond_create(&beam->change, pool);
         if (APR_SUCCESS == rv) {
-            apr_pool_pre_cleanup_register(pool, beam, beam_cleanup);
+            apr_pool_pre_cleanup_register(pool, beam, beam_pool_cleanup);
             *pbeam = beam;
         }
     }
index 2173683158ccba3b8c8dcc283c28a48e2c11858b..b2703de7120295f575cf56b5ed74c4ada3e1261d 100644 (file)
@@ -578,17 +578,7 @@ void h2_stream_destroy(h2_stream *stream)
     ap_assert(stream);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE3, 0, stream->session->c, 
                   H2_STRM_MSG(stream, "destroy"));
-    if (stream->pool) {
-        apr_pool_destroy(stream->pool);
-        stream->pool = NULL;
-    }
-}
-
-apr_pool_t *h2_stream_detach_pool(h2_stream *stream)
-{
-    apr_pool_t *pool = stream->pool;
-    stream->pool = NULL;
-    return pool;
+    apr_pool_destroy(stream->pool);
 }
 
 apr_status_t h2_stream_prep_processing(h2_stream *stream)
index 6bbfb5eef2c9f01be9df44ea827dd41079d8955b..ba63a3867ef5edd3c3ff9f8a92a0b4ba1b470db8 100644 (file)
@@ -157,15 +157,6 @@ void h2_stream_dispatch(h2_stream *stream, h2_stream_event_t ev);
  */
 void h2_stream_cleanup(h2_stream *stream);
 
-/**
- * Detach the memory pool from the stream. Will prevent stream
- * destruction to take the pool with it.
- *
- * @param stream the stream to detach the pool from
- * @result the detached memory pool or NULL if stream no longer has one
- */
-apr_pool_t *h2_stream_detach_pool(h2_stream *stream);
-
 /**
  * Notify the stream that amount bytes have been consumed of its input
  * since the last invocation of this method (delta amount).
index 7d93f37ec50a8a7fee9e741f2a3b0429a1416878..ab749c4acdf7e6ec8db58aab64b5f7781029ceb2 100644 (file)
@@ -27,7 +27,7 @@
  * @macro
  * Version number of the http2 module as c string
  */
-#define MOD_HTTP2_VERSION "1.10.15-DEV"
+#define MOD_HTTP2_VERSION "1.10.16-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 0x010a0f
+#define MOD_HTTP2_VERSION_NUM 0x010a10
 
 
 #endif /* mod_h2_h2_version_h */