From: Stefan Eissing Date: Sun, 12 Mar 2017 14:02:33 +0000 (+0000) Subject: On the trunk: X-Git-Tag: 2.5.0-alpha~567 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e21b7d0225bb72d5dd9a956d720a469dddded77;p=apache On the trunk: mod_http2: session pool cleanup at pre_close. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1786575 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http2/h2_session.c b/modules/http2/h2_session.c index 61181688f7..e27b48cba6 100644 --- a/modules/http2/h2_session.c +++ b/modules/http2/h2_session.c @@ -712,6 +712,7 @@ static apr_status_t session_cleanup(h2_session *session, const char *trigger) session->ngh2 = NULL; h2_ctx_clear(c); + return APR_SUCCESS; } @@ -2229,9 +2230,19 @@ out: apr_status_t h2_session_pre_close(h2_session *session, int async) { + apr_status_t status; + ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, session->c, H2_SSSN_MSG(session, "pre_close")); dispatch_event(session, H2_SESSION_EV_PRE_CLOSE, 0, (session->state == H2_SESSION_ST_IDLE)? "timeout" : NULL); - return session_cleanup(session, "pre_close"); + status = session_cleanup(session, "pre_close"); + if (status == APR_SUCCESS) { + /* no one should hold a reference to this session any longer and + * the h2_ctx was removed from the connection. + * Take the pool (and thus all subpools etc. down now, instead of + * during cleanup of main connection pool. */ + apr_pool_destroy(session->pool); + } + return status; }