From: Stefan Eissing Date: Tue, 30 Jan 2018 10:09:36 +0000 (+0000) Subject: On the trunk: X-Git-Tag: 2.5.0-alpha2-ci-test-only~2910 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14cb0179e462b775021d8c1ba9dcc680a4218095;p=thirdparty%2Fapache%2Fhttpd.git On the trunk: 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 --- diff --git a/CHANGES b/CHANGES index 79f3b8d0e57..0f1e92c3f5c 100644 --- 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] diff --git a/modules/http2/h2_bucket_beam.c b/modules/http2/h2_bucket_beam.c index 33439b8fdeb..6b6750d1fa1 100644 --- a/modules/http2/h2_bucket_beam.c +++ b/modules/http2/h2_bucket_beam.c @@ -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; } } diff --git a/modules/http2/h2_stream.c b/modules/http2/h2_stream.c index 2173683158c..b2703de7120 100644 --- a/modules/http2/h2_stream.c +++ b/modules/http2/h2_stream.c @@ -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) diff --git a/modules/http2/h2_stream.h b/modules/http2/h2_stream.h index 6bbfb5eef2c..ba63a3867ef 100644 --- a/modules/http2/h2_stream.h +++ b/modules/http2/h2_stream.h @@ -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). diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index 7d93f37ec50..ab749c4acdf 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -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 */