From cc9e70f2c5cc8707247f7042dce99d694d1f3b2d Mon Sep 17 00:00:00 2001 From: Jean-Frederic Clere Date: Sat, 29 Jul 2006 10:13:25 +0000 Subject: [PATCH] Stops when can't attach to httpd memory. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-proxy-scoreboard@426777 13f79535-47bb-0310-9956-ffa450edef68 --- support/proxymonitor.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/support/proxymonitor.c b/support/proxymonitor.c index 9a3242ea27b..0411eaf2dfb 100644 --- a/support/proxymonitor.c +++ b/support/proxymonitor.c @@ -74,6 +74,10 @@ static apr_status_t init_healthck(apr_pool_t *pool, int *num) sharedmem_initglobalpool(pool); checkstorage = sharedmem_getstorage(); rv = checkstorage->ap_slotmem_attach(&myscore, "proxy/checker", &size, num, pool); + if (rv != APR_SUCCESS) { + apr_file_printf(errfile, "Can't attach to httpd memory error: %d\n", rv); + return rv; + } health_checker_init_slotmem_storage(checkstorage); health_checker_init_slotmem(myscore); @@ -175,6 +179,10 @@ int process_sharedmem(apr_pool_t *pool, int num) for (n = 0; n < num; n++) { rv = worker_storage->get_entryconf(n, &worker, &balancer_name, pool); + if (rv != APR_SUCCESS) { + apr_file_printf(errfile, "Can't read entry %d\n", n); + return rv; + } if (worker->used == 0 || worker->used == 2) continue; worker_storage->get_health(n, &status); @@ -190,6 +198,7 @@ int process_sharedmem(apr_pool_t *pool, int num) worker_storage->set_health(n, HEALTH_OK); } } + return APR_SUCCESS; } /* @@ -272,7 +281,8 @@ int main(int argc, const char * const argv[]) if (instance_socket == NULL) { apr_pool_create(&instance_socket, pool); - init_healthck(instance_socket, &num); + status = init_healthck(instance_socket, &num); + return 1; } apr_pool_create(&instance, instance_socket); -- 2.47.2