You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jf...@apache.org on 2006/08/03 17:51:22 UTC
svn commit: r428433 -
/httpd/httpd/branches/httpd-proxy-scoreboard/support/proxymonitor.c
Author: jfclere
Date: Thu Aug 3 08:51:21 2006
New Revision: 428433
URL: http://svn.apache.org/viewvc?rev=428433&view=rev
Log:
Add a parameter for the filename.
Modified:
httpd/httpd/branches/httpd-proxy-scoreboard/support/proxymonitor.c
Modified: httpd/httpd/branches/httpd-proxy-scoreboard/support/proxymonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/httpd-proxy-scoreboard/support/proxymonitor.c?rev=428433&r1=428432&r2=428433&view=diff
==============================================================================
--- httpd/httpd/branches/httpd-proxy-scoreboard/support/proxymonitor.c (original)
+++ httpd/httpd/branches/httpd-proxy-scoreboard/support/proxymonitor.c Thu Aug 3 08:51:21 2006
@@ -62,6 +62,7 @@
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 @@
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 @@
{
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 @@
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,12 +269,20 @@
}
basedir = apr_pstrdup(pool, arg);
break;
+ case 'n':
+ if (filename) {
+ usage();
+ }
+ filename = apr_pstrdup(pool, arg);
+ break;
default:
usage();
} /* switch */
} /* else */
} /* while */
if (basedir == NULL)
+ usage();
+ if (filename == NULL)
usage();
instance_socket = NULL;