httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From minf...@apache.org
Subject svn commit: r1470683 - /httpd/httpd/trunk/server/mpm/simple/simple_io.c
Date Mon, 22 Apr 2013 19:50:25 GMT
Author: minfrin
Date: Mon Apr 22 19:50:25 2013
New Revision: 1470683

URL: http://svn.apache.org/r1470683
Log:
simple MPM: Lift the restriction that prevents mod_ssl taking
full advantage of the event MPM. Enable the ability for a module
to reverse the sense of a poll event from a read to a write or vice
versa.

Modified:
    httpd/httpd/trunk/server/mpm/simple/simple_io.c

Modified: httpd/httpd/trunk/server/mpm/simple/simple_io.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/simple/simple_io.c?rev=1470683&r1=1470682&r2=1470683&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/simple/simple_io.c (original)
+++ httpd/httpd/trunk/server/mpm/simple/simple_io.c Mon Apr 22 19:50:25 2013
@@ -51,9 +51,11 @@ static apr_status_t simple_io_process(si
     conn_rec *c;
 
     if (scon->c->clogging_input_filters && !scon->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.
+        /* Since we have an input filter which 'clogs' the input stream,
+         * like mod_ssl used to, lets just do the normal read from input
+         * filters, like the Worker MPM does. Filters that need to write
+         * where they would otherwise read, or read where they would
+         * otherwise write, should set the sense appropriately.
          */
         ap_run_process_connection(scon->c);
         if (scon->cs.state != CONN_STATE_SUSPENDED) {
@@ -117,7 +119,10 @@ static apr_status_t simple_io_process(si
                                       timeout : ap_server_conf->timeout,
                                       scon->pool);
 
-                scon->pfd.reqevents = APR_POLLOUT | APR_POLLHUP | APR_POLLERR;
+                scon->pfd.reqevents = (
+                        scon->cs.sense == CONN_SENSE_WANT_READ ? APR_POLLIN :
+                                APR_POLLOUT) | APR_POLLHUP | APR_POLLERR;
+                scon->cs.sense = CONN_SENSE_DEFAULT;
 
                 rv = apr_pollcb_add(sc->pollcb, &scon->pfd);
 
@@ -155,7 +160,10 @@ static apr_status_t simple_io_process(si
                                   timeout : ap_server_conf->timeout,
                                   scon->pool);
 
-            scon->pfd.reqevents = APR_POLLIN;
+            scon->pfd.reqevents = (
+                    scon->cs.sense == CONN_SENSE_WANT_WRITE ? APR_POLLOUT :
+                            APR_POLLIN);
+            scon->cs.sense = CONN_SENSE_DEFAULT;
 
             rv = apr_pollcb_add(sc->pollcb, &scon->pfd);
 
@@ -233,6 +241,7 @@ static void *simple_io_setup_conn(apr_th
     }
 
     scon->cs.state = CONN_STATE_READ_REQUEST_LINE;
+    scon->cs.sense = CONN_SENSE_DEFAULT;
 
     rv = simple_io_process(scon);
 



Mime
View raw message