Commit 04d947b1 authored by Doug MacEachern's avatar Doug MacEachern
Browse files

if ssl shutdown happens earlier than expected, filter code needs be aware


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90227 13f79535-47bb-0310-9956-ffa450edef68
parent 0de2f142
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
+10 −0
Original line number Diff line number Diff line
@@ -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");