httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ic...@apache.org
Subject svn commit: r1714802 - in /httpd/httpd/trunk/modules/http2: h2_session.c h2_session.h h2_stream.c
Date Tue, 17 Nov 2015 14:51:32 GMT
Author: icing
Date: Tue Nov 17 14:51:31 2015
New Revision: 1714802

URL: http://svn.apache.org/viewvc?rev=1714802&view=rev
Log:
early release of h2_mplx on session end

Modified:
    httpd/httpd/trunk/modules/http2/h2_session.c
    httpd/httpd/trunk/modules/http2/h2_session.h
    httpd/httpd/trunk/modules/http2/h2_stream.c

Modified: httpd/httpd/trunk/modules/http2/h2_session.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_session.c?rev=1714802&r1=1714801&r2=1714802&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_session.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_session.c Tue Nov 17 14:51:31 2015
@@ -662,9 +662,20 @@ h2_session *h2_session_rcreate(request_r
     return h2_session_create_int(r->connection, r, config, workers);
 }
 
-void h2_session_cleanup(h2_session *session)
+static void h2_session_cleanup(h2_session *session)
 {
     AP_DEBUG_ASSERT(session);
+    /* This is an early cleanup of the session that may
+     * discard what is no longer necessary for *new* streams
+     * and general HTTP/2 processing.
+     * At this point, all frames are in transit or somehwere in
+     * our buffers or passed down output filters.
+     * h2 streams might still being written out.
+     */
+    if (session->mplx) {
+        h2_mplx_release_and_join(session->mplx, session->iowait);
+        session->mplx = NULL;
+    }
     if (session->ngh2) {
         nghttp2_session_del(session->ngh2);
         session->ngh2 = NULL;
@@ -673,10 +684,6 @@ void h2_session_cleanup(h2_session *sess
         apr_pool_destroy(session->spare);
         session->spare = NULL;
     }
-    if (session->mplx) {
-        h2_mplx_release_and_join(session->mplx, session->iowait);
-        session->mplx = NULL;
-    }
 }
 
 void h2_session_destroy(h2_session *session)
@@ -1194,11 +1201,18 @@ apr_status_t h2_session_stream_destroy(h
 {
     apr_pool_t *pool = h2_stream_detach_pool(stream);
 
-    h2_mplx_stream_done(session->mplx, stream->id, stream->rst_error);
-    if (session->last_stream == stream) {
-        session->last_stream = NULL;
+    /* this may be called while the session has already freed
+     * some internal structures. */
+    if (session->mplx) {
+        h2_mplx_stream_done(session->mplx, stream->id, stream->rst_error);
+        if (session->last_stream == stream) {
+            session->last_stream = NULL;
+        }
+    }
+    
+    if (session->streams) {
+        h2_stream_set_remove(session->streams, stream->id);
     }
-    h2_stream_set_remove(session->streams, stream->id);
     h2_stream_destroy(stream);
     
     if (pool) {

Modified: httpd/httpd/trunk/modules/http2/h2_session.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_session.h?rev=1714802&r1=1714801&r2=1714802&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_session.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_session.h Tue Nov 17 14:51:31 2015
@@ -123,14 +123,6 @@ apr_status_t h2_session_process(h2_sessi
 void h2_session_destroy(h2_session *session);
 
 /**
- * Cleanup session data while winding down. No new streams
- * may be created afterwards, but existing stream can still be
- * looked up.
- * Called automatically on destroy.
- */
-void h2_session_cleanup(h2_session *session);
-
-/**
  * Cleanup the session and all objects it still contains. This will not
  * destroy h2_task instances that have not finished yet. 
  * @param session the session to destroy

Modified: httpd/httpd/trunk/modules/http2/h2_stream.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_stream.c?rev=1714802&r1=1714801&r2=1714802&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_stream.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_stream.c Tue Nov 17 14:51:31 2015
@@ -305,7 +305,7 @@ static apr_status_t h2_stream_input_flus
         if (status != APR_SUCCESS) {
             ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, stream->session->mplx->c,
                           "h2_stream(%ld-%d): flushing input data",
-                          stream->session->mplx->id, stream->id);
+                          stream->session->id, stream->id);
         }
     }
     return status;



Mime
View raw message