]> granicus.if.org Git - apache/commitdiff
if ssl shutdown happens earlier than expected, filter code needs be aware
authorDoug MacEachern <dougm@apache.org>
Thu, 16 Aug 2001 17:01:53 +0000 (17:01 +0000)
committerDoug MacEachern <dougm@apache.org>
Thu, 16 Aug 2001 17:01:53 +0000 (17:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90227 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/mod_ssl.c
modules/ssl/ssl_engine_io.c

index 28117e6a309ea967069f0a71989134a340b2a5d1..84d099e2f33215cb2a3b3e98b1db05de3e9f5eda 100644 (file)
@@ -424,6 +424,7 @@ int ssl_hook_process_connection(SSLFilterRec *pRec)
             SSL_set_shutdown(pRec->pssl, SSL_RECEIVED_SHUTDOWN);
             SSL_smart_shutdown(pRec->pssl);
             SSL_free(pRec->pssl);
+            pRec->pssl = NULL; /* so filters know we've been shutdown */
             apr_table_setn(c->notes, "ssl", NULL);
             c->aborted = 1;
             return APR_EGENERAL;
index f981a2d455630c5f20ce7c870ad5634fcf3de588..37873860072791dbd22a8187466b2f50e8d343c7 100644 (file)
@@ -167,6 +167,11 @@ static apr_status_t churn_output(SSLFilterRec *pRec)
     apr_bucket_brigade *pbbOutput=NULL;
     int done;
 
+    if (!pRec->pssl) {
+        /* we've been shutdown */
+        return APR_EOF;
+    }
+
     do {
        char buf[1024];
        int n;
@@ -417,6 +422,11 @@ apr_status_t ssl_io_filter_cleanup (void *data)
     apr_status_t ret;
     SSLFilterRec *pRec = (SSLFilterRec *)data;
 
+    if (!pRec->pssl) {
+        /* already been shutdown */
+        return APR_SUCCESS;
+    }
+
     if ((ret = ssl_hook_CloseConnection(pRec)) != APR_SUCCESS) {
         ap_log_error(APLOG_MARK, APLOG_ERR, ret, NULL,
                      "Error in ssl_hook_CloseConnection");