Author: jfrederic.clere(a)jboss.com
Date: 2008-05-22 10:52:58 -0400 (Thu, 22 May 2008)
New Revision: 1613
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
The sub pool is needed to create the socket.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-05-22 13:26:46 UTC
(rev 1612)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2008-05-22 14:52:58 UTC
(rev 1613)
@@ -198,6 +198,7 @@
apr_pool_t *pool)
{
apr_pool_t *ctx;
+ apr_pool_t *scpool;
proxy_conn_rec *conn;
proxy_worker *worker = (proxy_worker *)params;
@@ -209,7 +210,18 @@
apr_pool_create(&ctx, pool);
conn = apr_pcalloc(pool, sizeof(proxy_conn_rec));
+ /*
+ * Create another subpool that manages the data for the
+ * socket and the connection member of the proxy_conn_rec struct as we
+ * destroy this data more frequently than other data in the proxy_conn_rec
+ * struct like hostname and addr (at least in the case where we have
+ * keepalive connections that timed out).
+ */
+ apr_pool_create(&scpool, ctx);
+ apr_pool_tag(scpool, "proxy_conn_scpool");
+
conn->pool = ctx;
+ conn->scpool = scpool;
conn->worker = worker;
#if APR_HAS_THREADS
conn->inreslist = 1;
@@ -629,6 +641,7 @@
proxy_conn_rec *conn;
/* get the proxy_conn_rec: from ap_proxy_acquire_connection */
#if APR_HAS_THREADS
+ /* prefork() is not "safe" as we have now 2 threads... */
if (worker->hmax && worker->cp->res) {
rv = apr_reslist_acquire(worker->cp->res, (void **)&conn);
}
Show replies by date