You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2016/01/23 04:53:46 UTC
svn commit: r1726351 - /httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
Author: jim
Date: Sat Jan 23 03:53:45 2016
New Revision: 1726351
URL: http://svn.apache.org/viewvc?rev=1726351&view=rev
Log:
Use a shorter-lived pool to conserve mem.
Modified:
httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c?rev=1726351&r1=1726350&r2=1726351&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c Sat Jan 23 03:53:45 2016
@@ -68,6 +68,7 @@ typedef struct {
} wctx_t;
typedef struct {
+ apr_pool_t *ptemp;
sctx_t *ctx;
proxy_worker *worker;
apr_time_t now;
@@ -766,10 +767,9 @@ static void *hc_check(apr_thread_t *thre
sctx_t *ctx = baton->ctx;
apr_time_t now = baton->now;
proxy_worker *worker = baton->worker;
+ apr_pool_t *ptemp = baton->ptemp;
server_rec *s = ctx->s;
apr_status_t rv;
- apr_pool_t *ptemp;
- apr_pool_create(&ptemp, ctx->p);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(03256)
"%sHealth checking %s", (thread ? "Threaded " : ""), worker->s->name);
@@ -876,13 +876,18 @@ static apr_status_t hc_watchdog_callback
worker->s->name, worker->s->method, worker);
if ((worker->s->method != NONE) && (now > worker->s->updated + worker->s->interval)) {
baton_t *baton;
+ /* This pool must last the lifetime of the (possible) thread */
+ apr_pool_t *ptemp;
+ apr_pool_create(&ptemp, ctx->p);
+
if ((rv = hc_init_worker(ctx, worker)) != APR_SUCCESS) {
return rv;
}
- baton = apr_palloc(ctx->p, sizeof(baton_t));
+ baton = apr_palloc(ptemp, sizeof(baton_t));
baton->ctx = ctx;
baton->now = now;
baton->worker = worker;
+ baton->ptemp = ptemp;
if (ctx->hctp) {
#if HC_USE_THREADS