Commit cdf08aab authored by Stefan Eissing's avatar Stefan Eissing
Browse files

mod_proxy_http2: detect TLS close notify on backend connection, patch by Yann Ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1750505 13f79535-47bb-0310-9956-ffa450edef68
parent 785c4d84
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -520,10 +520,19 @@ run_connect:
    }

    ctx->p_conn->is_ssl = ctx->is_ssl;
    if (ctx->is_ssl) {
        /* If there is still some data on an existing ssl connection, now
         * would be a good timne to get rid of it. */
        ap_proxy_ssl_connection_cleanup(ctx->p_conn, ctx->rbase);
    if (ctx->is_ssl && ctx->p_conn->connection) {
        /* If there are some metadata on the connection (e.g. TLS alert),
         * let mod_ssl detect them, and create a new connection below.
         */ 
        apr_bucket_brigade *tmp_bb;
        tmp_bb = apr_brigade_create(ctx->rbase->pool, 
                                    ctx->rbase->connection->bucket_alloc);
        status = ap_get_brigade(ctx->p_conn->connection->input_filters, tmp_bb,
                                AP_MODE_SPECULATIVE, APR_NONBLOCK_READ, 1);
        if (status != APR_SUCCESS && !APR_STATUS_IS_EAGAIN(status)) {
            ctx->p_conn->close = 1;
        }
        apr_brigade_cleanup(tmp_bb);
    }   

    /* Step One: Determine the URL to connect to (might be a proxy),