From: Doug MacEachern Date: Thu, 16 Aug 2001 17:01:53 +0000 (+0000) Subject: if ssl shutdown happens earlier than expected, filter code needs be aware X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae5ce9152beeef5436be745202937b5ef9970e9e;p=thirdparty%2Fapache%2Fhttpd.git if ssl shutdown happens earlier than expected, filter code needs be aware git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@90227 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/mod_ssl.c b/mod_ssl.c index 28117e6a309..84d099e2f33 100644 --- a/mod_ssl.c +++ b/mod_ssl.c @@ -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; diff --git a/ssl_engine_io.c b/ssl_engine_io.c index f981a2d4556..37873860072 100644 --- a/ssl_engine_io.c +++ b/ssl_engine_io.c @@ -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");