]> granicus.if.org Git - apache/commitdiff
On the trunk:
authorStefan Eissing <icing@apache.org>
Sun, 12 Mar 2017 14:02:33 +0000 (14:02 +0000)
committerStefan Eissing <icing@apache.org>
Sun, 12 Mar 2017 14:02:33 +0000 (14:02 +0000)
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

modules/http2/h2_session.c

index 61181688f757a6687e92e947dd97c8df3583ed40..e27b48cba65348d7d128bbefd60826f3ebb97c2d 100644 (file)
@@ -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;
 }