Commit 68b7908f authored by Yann Ylavic's avatar Yann Ylavic
Browse files

Follow up to r1859371: extend to other ap_proxy_connection_create[_ex]() users.

This function now now handles SSL reuse as well as the "proxy-request-hostname"
note (SNI), so let's also call it unconditionnaly in all proxy modules.

On the mod_ssl side, since this note has the lifetime of the connection, don't
reset/unset it during handshake (ssl_io_filter_handshake).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1859422 13f79535-47bb-0310-9956-ffa450edef68
parent efc0a47d
Loading
Loading
Loading
Loading
+16 −26
Original line number Diff line number Diff line
@@ -387,7 +387,6 @@ run_connect:
    }
    
    /* Step Three: Create conn_rec for the socket we have open now. */
    if (!ctx->p_conn->connection) {
    status = ap_proxy_connection_create_ex(ctx->proxy_func, ctx->p_conn, ctx->r);
    if (status != OK) {
        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, ctx->owner, APLOGNO(03353)
@@ -404,15 +403,6 @@ run_connect:
         */
        apr_table_setn(ctx->p_conn->connection->notes,
                       "proxy-request-alpn-protos", "h2");
            if (ctx->p_conn->ssl_hostname) {
                ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, ctx->owner, 
                              "set SNI to %s for (%s)", 
                              ctx->p_conn->ssl_hostname, 
                              ctx->p_conn->hostname);
                apr_table_setn(ctx->p_conn->connection->notes,
                               "proxy-request-hostname", ctx->p_conn->ssl_hostname);
            }
        }
    }

    if (ctx->master->aborted) goto cleanup;
+4 −6
Original line number Diff line number Diff line
@@ -1196,13 +1196,11 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
        return HTTP_SERVICE_UNAVAILABLE;
    }

    if (!backend->connection) {
    status = ap_proxy_connection_create_ex("FTP", backend, r);
    if (status != OK) {
        proxy_ftp_cleanup(r, backend);
        return status;
    }
    }

    /* Use old naming */
    origin = backend->connection;
+2 −4
Original line number Diff line number Diff line
@@ -766,11 +766,9 @@ static apr_status_t hc_check_http(baton_t *baton)
    }

    r = create_request_rec(ptemp, ctx->s, baton->balancer, wctx->method);
    if (!backend->connection) {
    if ((status = ap_proxy_connection_create_ex("HCOH", backend, r)) != OK) {
        return backend_cleanup("HCOH", backend, ctx->s, status);
    }
    }
    set_request_connection(r, backend->connection);

    bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
+4 −6
Original line number Diff line number Diff line
@@ -509,12 +509,10 @@ static int uwsgi_handler(request_rec *r, proxy_worker * worker,
    }

    /* Step Three: Create conn_rec */
    if (!backend->connection) {
    if ((status = ap_proxy_connection_create(UWSGI_SCHEME, backend,
                                             r->connection,
                                             r->server)) != OK)
        goto cleanup;
    }

    /* Step Four: Process the Request */
    if (((status = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK)
+3 −5
Original line number Diff line number Diff line
@@ -523,12 +523,10 @@ static int proxy_wstunnel_handler(request_rec *r, proxy_worker *worker,
    }

    /* Step Three: Create conn_rec */
    if (!backend->connection) {
    status = ap_proxy_connection_create_ex(scheme, backend, r);
    if (status  != OK) {
        goto cleanup;
    }
    }

    /* Step Four: Process the Request */
    status = proxy_wstunnel_request(p, r, backend, worker, conf, uri, locurl,
Loading