]> granicus.if.org Git - apache/commitdiff
Add a clogging_input_filters variable to the conn_rec, enabling the Event MPM to...
authorPaul Querna <pquerna@apache.org>
Tue, 12 Jun 2007 00:32:24 +0000 (00:32 +0000)
committerPaul Querna <pquerna@apache.org>
Tue, 12 Jun 2007 00:32:24 +0000 (00:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@546328 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
include/httpd.h
modules/http/http_core.c
modules/ssl/ssl_engine_io.c
server/core.c
server/mpm/experimental/event/event.c

diff --git a/CHANGES b/CHANGES
index 70b375599255063dfddc18ee1f460e4cf5f502c1..85d652c09d3abcbec79e4dca461ccfc2c679e802 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) Event MPM: Add support for running under mod_ssl, by reverting to the
+     Worker MPM behaviors, when run under an input filter that buffers
+     its own data. [Paul Querna]
+
   *) mod_ssl: Add support for caching SSL Sessions in memcached. [Paul Querna]
 
   *) SECURITY: CVE-2007-1862 (cve.mitre.org)
index 601a8aaf34d9a1f3bd4d222c0e197265941df555..33037ee3fc70739c2d7f2d8f6d031a542ea673e1 100644 (file)
@@ -1081,6 +1081,11 @@ struct conn_rec {
     int data_in_input_filters;
     /** Is there data pending in the output filters? */
     int data_in_output_filters;
+    
+    /** Are there any filters that clogg/buffer the input stream, breaking
+     *  the event mpm.
+     */
+    int clogging_input_filters;
 };
 
 /** 
index e5f109155cf7c3fd63f6307ca93ae4df9753db06..86f042b220c607a1586f707106e7d7d0f540bbc5 100644 (file)
@@ -119,11 +119,17 @@ static apr_port_t http_port(const request_rec *r)
     return DEFAULT_HTTP_PORT;
 }
 
+static int ap_process_http_connection(conn_rec *c);
+
 static int ap_process_http_async_connection(conn_rec *c)
 {
     request_rec *r;
     conn_state_t *cs = c->cs;
 
+    if (c->clogging_input_filters) {
+        return ap_process_http_connection(c);
+    }
+    
     AP_DEBUG_ASSERT(cs->state == CONN_STATE_READ_REQUEST_LINE);
 
     while (cs->state == CONN_STATE_READ_REQUEST_LINE) {
index 5c667d7682a0e86eb695744ca0984bd66c44dd26..0500932c95e56fe7de13c32e40f942502a93ecd7 100644 (file)
@@ -1665,6 +1665,9 @@ void ssl_io_filter_init(conn_rec *c, SSL *ssl)
     filter_ctx->pbioWrite       = BIO_new(&bio_filter_out_method);
     filter_ctx->pbioWrite->ptr  = (void *)bio_filter_out_ctx_new(filter_ctx, c);
 
+    /* We insert a clogging input filter. Let the core know. */
+    c->clogging_input_filters = 1;
+    
     ssl_io_input_add_filter(filter_ctx, c, ssl);
 
     SSL_set_bio(ssl, filter_ctx->pbioRead, filter_ctx->pbioWrite);
index 46ff1446e0b2fd94b0dcee581b79c0b8e925e147..6e163eca11f7132041d2aefb1f02cdb2b3a40e08 100644 (file)
@@ -3803,6 +3803,7 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server,
     c->cs->c = c;
     c->cs->p = ptrans;
     c->cs->bucket_alloc = alloc;
+    c->clogging_input_filters = 0;
 
     return c;
 }
index 417f360cc13a49f201c0e7fee1ae91c939ba298f..37ded5afb7a2cf8fe2dc5b5a1f5705050473a544 100644 (file)
@@ -620,6 +620,16 @@ static int process_socket(apr_pool_t * p, apr_socket_t * sock,
         pt = cs->pfd.client_data;
     }
 
+    if (c->clogging_input_filters && !c->aborted) {
+        /* Since we have an input filter which 'cloggs' the input stream,
+         * like mod_ssl, lets just do the normal read from input filters,
+         * like the Worker MPM does.
+         */
+        ap_run_process_connection(c);
+        ap_lingering_close(c);
+        return 0;
+    }
+
 read_request:
     if (cs->state == CONN_STATE_READ_REQUEST_LINE) {
         if (!c->aborted) {