You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Bill Stoddard <bi...@wstoddard.com> on 2001/12/22 06:38:38 UTC

[PATCH] Bypass ap_run_process_connection...

If the pre_connection hook detects the connection has gone away. I notice that mod_ssl can
detect aborted connections in the preconnection hook. Seems a good idea to make a check
here and just skip ap_run_process_connection is the connection is gone.

Index: connection.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/connection.c,v
retrieving revision 1.95
diff -u -r1.95 connection.c
--- connection.c 2001/12/18 13:48:52 1.95
+++ connection.c 2001/12/22 05:34:23
@@ -226,6 +226,7 @@

     ap_run_pre_connection(c);

-    ap_run_process_connection(c);
-
+    if (!c->aborted) {
+        ap_run_process_connection(c);
+    }
 }


Re: [PATCH] Bypass ap_run_process_connection...

Posted by Jeff Trawick <tr...@attglobal.net>.
"Bill Stoddard" <bi...@wstoddard.com> writes:

> If the pre_connection hook detects the connection has gone away. I notice that mod_ssl can
> detect aborted connections in the preconnection hook. Seems a good idea to make a check
> here and just skip ap_run_process_connection is the connection is gone.

like this code?

    if ((ssl = SSL_new(sc->pSSLCtx)) == NULL) {
        ssl_log(c->base_server, SSL_LOG_ERROR|SSL_ADD_SSLERR,
                "Unable to create a new SSL connection from the SSL context");
        c->aborted = 1;
        return DECLINED; /* XXX */
    } 

I guess that "DECLINED; /* XXX */" was an act of frustration that the
core code didn't look at c->aborted and there was nothing that could
be returned to cause the core code to skip further processing?

Your patch seems like a reasonable fix.

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...