]> granicus.if.org Git - apache/commitdiff
mpm_event: follow up to r1818804 and r1818960.
authorYann Ylavic <ylavic@apache.org>
Sun, 24 Dec 2017 11:39:30 +0000 (11:39 +0000)
committerYann Ylavic <ylavic@apache.org>
Sun, 24 Dec 2017 11:39:30 +0000 (11:39 +0000)
Align mod_http2 with expected returned state from process_connection hooks in
async MPMs.
When the master connection is handled, enter CONN_STATE_LINGER in any case.

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

modules/http2/h2_conn.c
modules/http2/h2_h2.c
modules/http2/h2_switch.c

index 53497d03efe24f8b5c3019db7c3a45d12b6b772e..f37d95172740924019a0b78da44b83ca018e3861 100644 (file)
@@ -253,25 +253,12 @@ apr_status_t h2_conn_run(struct h2_ctx *ctx, conn_rec *c)
     } while (!async_mpm
              && c->keepalive == AP_CONN_KEEPALIVE 
              && mpm_state != AP_MPMQ_STOPPING);
-    
+
     if (c->cs) {
-        switch (session->state) {
-            case H2_SESSION_ST_INIT:
-            case H2_SESSION_ST_CLEANUP:
-            case H2_SESSION_ST_DONE:
-            case H2_SESSION_ST_IDLE:
-                c->cs->state = CONN_STATE_WRITE_COMPLETION;
-                break;
-            case H2_SESSION_ST_BUSY:
-            case H2_SESSION_ST_WAIT:
-            default:
-                c->cs->state = CONN_STATE_HANDLER;
-                break;
-                
-        }
+        c->cs->state = CONN_STATE_LINGER;
     }
-    
-    return DONE;
+
+    return APR_SUCCESS;
 }
 
 apr_status_t h2_conn_pre_close(struct h2_ctx *ctx, conn_rec *c)
index 8487e413f4b44db1daa6b4ef3d64983baaff6cd4..f206beb7886ca0a4e91c48a91927159fa3feacdc 100644 (file)
@@ -669,10 +669,11 @@ int h2_h2_process_conn(conn_rec* c)
             ap_log_cerror(APLOG_MARK, APLOG_TRACE1, status, c, "conn_setup");
             if (status != APR_SUCCESS) {
                 h2_ctx_clear(c);
-                return status;
+                return !OK;
             }
         }
-        return h2_conn_run(ctx, c);
+        h2_conn_run(ctx, c);
+        return OK;
     }
     
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c, "h2_h2, declined");
index 3a8567eb1b0bd9d7434c02e9366fba4cab970b3d..ef6ae29e0802c12fb25a8065c89cf112e11e36c6 100644 (file)
@@ -185,13 +185,12 @@ static int h2_protocol_switch(conn_rec *c, request_rec *r, server_rec *s,
                 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, status, r, APLOGNO(03088)
                               "session setup");
                 h2_ctx_clear(c);
-                return status;
+                return !OK;
             }
             
             h2_conn_run(ctx, c);
-            return DONE;
         }
-        return DONE;
+        return OK;
     }
     
     return DECLINED;