* CONNECTION related...
*/
+static void socket_cleanup(proxy_conn_rec *conn)
+{
+ conn->sock = NULL;
+ conn->connection = NULL;
+ conn->ssl_hostname = NULL;
+ apr_pool_clear(conn->scpool);
+}
+
static apr_status_t conn_pool_cleanup(void *theworker)
{
proxy_worker *worker = (proxy_worker *)theworker;
}
/* determine if the connection need to be closed */
- if (!ap_proxy_connection_reusable(conn)) {
+ if (!worker->s->is_address_reusable || worker->s->disablereuse) {
apr_pool_t *p = conn->pool;
apr_pool_clear(p);
conn = apr_pcalloc(p, sizeof(proxy_conn_rec));
apr_pool_create(&(conn->scpool), p);
apr_pool_tag(conn->scpool, "proxy_conn_scpool");
}
+ else if (conn->close) {
+ socket_cleanup(conn);
+ conn->close = 0;
+ }
if (worker->s->hmax && worker->cp->res) {
conn->inreslist = 1;
return APR_SUCCESS;
}
-static void socket_cleanup(proxy_conn_rec *conn)
-{
- conn->sock = NULL;
- conn->connection = NULL;
- conn->ssl_hostname = NULL;
- apr_pool_clear(conn->scpool);
-}
-
PROXY_DECLARE(apr_status_t) ap_proxy_ssl_connection_cleanup(proxy_conn_rec *conn,
request_rec *r)
{
proxy_function, backend_addr->family, worker->s->hostname);
if (conf->source_address_set) {
- local_addr = apr_pmemdup(conn->pool, conf->source_address,
+ local_addr = apr_pmemdup(conn->scpool, conf->source_address,
sizeof(apr_sockaddr_t));
- local_addr->pool = conn->pool;
+ local_addr->pool = conn->scpool;
rv = apr_socket_bind(newsock, local_addr);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(00956)