httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r546328 - in /httpd/httpd/trunk: CHANGES include/httpd.h modules/http/http_core.c modules/ssl/ssl_engine_io.c server/core.c server/mpm/experimental/event/event.c
Date Tue, 12 Jun 2007 00:32:25 GMT
Author: pquerna
Date: Mon Jun 11 17:32:24 2007
New Revision: 546328

URL: http://svn.apache.org/viewvc?view=rev&rev=546328
Log:
Add a clogging_input_filters variable to the conn_rec, enabling the Event MPM to know when
its running with an input filter that buffers its own data, like mod_ssl.

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

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=546328&r1=546327&r2=546328
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Jun 11 17:32:24 2007
@@ -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)

Modified: httpd/httpd/trunk/include/httpd.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/httpd.h?view=diff&rev=546328&r1=546327&r2=546328
==============================================================================
--- httpd/httpd/trunk/include/httpd.h (original)
+++ httpd/httpd/trunk/include/httpd.h Mon Jun 11 17:32:24 2007
@@ -1081,6 +1081,11 @@
     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;
 };
 
 /** 

Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_core.c?view=diff&rev=546328&r1=546327&r2=546328
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Mon Jun 11 17:32:24 2007
@@ -119,11 +119,17 @@
     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) {

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_io.c?view=diff&rev=546328&r1=546327&r2=546328
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_io.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_io.c Mon Jun 11 17:32:24 2007
@@ -1665,6 +1665,9 @@
     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);

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?view=diff&rev=546328&r1=546327&r2=546328
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Mon Jun 11 17:32:24 2007
@@ -3803,6 +3803,7 @@
     c->cs->c = c;
     c->cs->p = ptrans;
     c->cs->bucket_alloc = alloc;
+    c->clogging_input_filters = 0;
 
     return c;
 }

Modified: httpd/httpd/trunk/server/mpm/experimental/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/event/event.c?view=diff&rev=546328&r1=546327&r2=546328
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/event.c Mon Jun 11 17:32:24 2007
@@ -620,6 +620,16 @@
         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) {



Mime
View raw message