diff options
author | Jean-Frederic Clere <jfclere@apache.org> | 2006-08-03 15:51:21 +0000 |
---|---|---|
committer | Jean-Frederic Clere <jfclere@apache.org> | 2006-08-03 15:51:21 +0000 |
commit | d98ed85ef9ad8d3491cebee4adc103b7fef155b6 (patch) | |
tree | 9b67a85d54c1facab7cee9e2b5fe7e8da3c7beb8 | |
parent | 0363bedc4ebb97cb39d5c7f64778f06fc66b8154 (diff) | |
download | httpd-d98ed85ef9ad8d3491cebee4adc103b7fef155b6.tar.gz |
Add a parameter for the filename.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpd-proxy-scoreboard@428433 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | support/proxymonitor.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/support/proxymonitor.c b/support/proxymonitor.c index ffb9157a26..c262c7d649 100644 --- a/support/proxymonitor.c +++ b/support/proxymonitor.c @@ -62,6 +62,7 @@ static const char *shortname = "proxymonitor"; static const health_worker_method *worker_storage; char *basedir = NULL; +char *filename = NULL; /* XXX: hack to use a part of the mod_sharedmem and mod_proxy_health_checker */ static apr_status_t init_healthck(apr_pool_t *pool, int *num) @@ -75,7 +76,7 @@ static apr_status_t init_healthck(apr_pool_t *pool, int *num) checkstorage = sharedmem_getstorage(); worker_storage->set_slotmem_storage_method(checkstorage); - rv = worker_storage->attach_slotmem("proxy/checker", num, pool); + rv = worker_storage->attach_slotmem(filename, num, pool); if (rv != APR_SUCCESS) { apr_file_printf(errfile, "Can't attach to httpd memory error: %d\n", rv); @@ -132,9 +133,11 @@ static void usage(void) { apr_file_printf(errfile, "%s -- program for monitoring proxies of httpd." NL - "Usage: %s [-n] [-pPATH] [-dINTERVAL] [-rN]" NL + "Usage: %s [-nFILENAME] [-pPATH] [-dINTERVAL] [-rN]" NL NL "Options:" NL + " -n Specify FILENAME to use to locate shared slotmem." NL + NL " -d Repeat checking every INTERVAL seconds." NL NL " -r Repeat checking N times." NL @@ -241,7 +244,7 @@ int main(int argc, const char * const argv[]) apr_getopt_init(&o, pool, argc, argv); while (1) { - status = apr_getopt(o, "p:d:r:", &opt, &arg); + status = apr_getopt(o, "n:p:d:r:", &opt, &arg); if (status == APR_EOF) { break; } @@ -266,6 +269,12 @@ int main(int argc, const char * const argv[]) } basedir = apr_pstrdup(pool, arg); break; + case 'n': + if (filename) { + usage(); + } + filename = apr_pstrdup(pool, arg); + break; default: usage(); } /* switch */ @@ -273,6 +282,8 @@ int main(int argc, const char * const argv[]) } /* while */ if (basedir == NULL) usage(); + if (filename == NULL) + usage(); instance_socket = NULL; |