httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <do...@covalent.net>
Subject fix t/ssl/http.t
Date Tue, 02 Apr 2002 16:08:44 GMT
the test started failing at some point due to filter changes.  i think i 
heard it is not longer possible for a filter to remove itself?  in any 
case, mod_ssl already checks in the output filter already passes if its 
ssl pointer is NULL (normally due to error).  the input filter should 
probably do the same too.  and with that it is simple to disable the ssl 
filters in the case of 'HTTP spoken on HTTPS port'
if there's a better way, that'd be great, but the patch below passes all 
httpd-tests for me.

Index: modules/ssl/ssl_engine_io.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v
retrieving revision 1.70
diff -u -r1.70 ssl_engine_io.c
--- modules/ssl/ssl_engine_io.c	30 Mar 2002 05:16:55 -0000	1.70
+++ modules/ssl/ssl_engine_io.c	2 Apr 2002 16:05:32 -0000
@@ -743,6 +743,13 @@
                                sizeof(HTTP_ON_HTTPS_PORT) - 1, \
                                alloc)
 
+static void ssl_io_filter_disable(ap_filter_t *f)
+{
+    ssl_io_input_ctx_t *ctx = f->ctx;
+    ctx->inbio.ssl = NULL;
+    ctx->frec->pssl = NULL;
+}
+
 static apr_status_t ssl_io_filter_error(ap_filter_t *f,
                                         apr_bucket_brigade *bb,
                                         apr_status_t status)
@@ -758,6 +765,7 @@
 
             /* fake the request line */
             bucket = HTTP_ON_HTTPS_PORT_BUCKET(f->c->bucket_alloc);
+            ssl_io_filter_disable(f);
             break;
 
       default:
@@ -780,6 +788,10 @@
 
     apr_size_t len = sizeof(ctx->buffer);
     int is_init = (mode == AP_MODE_INIT);
+
+    if (!ctx->inbio.ssl) {
+        return ap_get_brigade(f->next, bb, mode, block, readbytes);
+    }
 
     /* XXX: we don't currently support anything other than these modes. */
     if (mode != AP_MODE_READBYTES && mode != AP_MODE_GETLINE && 


Mime
View raw message