From: Mladen Turk Date: Sat, 11 Sep 2004 10:50:05 +0000 (+0000) Subject: Use worker as a parameter for connection_constructor. X-Git-Tag: 2.1.1~300 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5a5f85aad4ba891adc9b236f46b2c9524c4d3c53;p=apache Use worker as a parameter for connection_constructor. When min connections is greater then zero connstructor is called when the reslist is created. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105073 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 4f743621d8..c2f87680f0 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1345,7 +1345,7 @@ static apr_status_t connection_constructor(void **resource, void *params, { apr_pool_t *ctx; proxy_conn_rec *conn; - server_rec *s = (server_rec *)params; + proxy_worker *worker = (proxy_worker *)params; /* Create the subpool for each connection * This keeps the memory consumption constant @@ -1354,12 +1354,10 @@ static apr_status_t connection_constructor(void **resource, void *params, apr_pool_create(&ctx, pool); conn = apr_pcalloc(ctx, sizeof(proxy_conn_rec)); - conn->pool = ctx; + conn->pool = ctx; + conn->worker = worker; *resource = conn; - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, - "proxy: socket is constructed"); - return APR_SUCCESS; } @@ -1404,7 +1402,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser worker->min, worker->smax, worker->hmax, worker->ttl, connection_constructor, connection_destructor, - s, worker->cp->pool); + worker, worker->cp->pool); apr_pool_cleanup_register(worker->cp->pool, (void *)worker, conn_pool_cleanup, @@ -1424,7 +1422,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser #endif { - rv = connection_constructor((void **)&(worker->cp->conn), s, worker->cp->pool); + rv = connection_constructor((void **)&(worker->cp->conn), worker, worker->cp->pool); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "proxy: initialized single connection worker for (%s)", worker->hostname); @@ -1489,7 +1487,7 @@ PROXY_DECLARE(int) ap_proxy_acquire_connection(const char *proxy_function, { /* create the new connection if the previous was destroyed */ if (!worker->cp->conn) - connection_constructor((void **)conn, s, worker->cp->pool); + connection_constructor((void **)conn, worker, worker->cp->pool); else { *conn = worker->cp->conn; worker->cp->conn = NULL;