r4369 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Wed Nov 25 11:18:19 CET 2009
Author: phk
Date: 2009-11-25 11:18:19 +0100 (Wed, 25 Nov 2009)
New Revision: 4369
Modified:
trunk/varnish-cache/bin/varnishd/cache_acceptor.c
Log:
Add a debug.listen_address cli command to report the actual listen
address(es)
Modified: trunk/varnish-cache/bin/varnishd/cache_acceptor.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2009-11-25 09:54:19 UTC (rev 4368)
+++ trunk/varnish-cache/bin/varnishd/cache_acceptor.c 2009-11-25 10:18:19 UTC (rev 4369)
@@ -353,16 +353,46 @@
VSL(SLT_Debug, 0, "Acceptor is %s", vca_act->name);
}
+/*--------------------------------------------------------------------*/
+
+static void
+ccf_listen_address(struct cli *cli, const char * const *av, void *priv)
+{
+ struct listen_sock *ls;
+ char h[32], p[32];
+
+ (void)cli;
+ (void)av;
+ (void)priv;
+ VTAILQ_FOREACH(ls, &heritage.socks, list) {
+ if (ls->sock < 0)
+ continue;
+ TCP_myname(ls->sock, h, sizeof h, p, sizeof p);
+ cli_out(cli, "%s %s\n", h, p);
+ }
+}
+
+/*--------------------------------------------------------------------*/
+
static struct cli_proto vca_cmds[] = {
{ CLI_SERVER_START, ccf_start },
{ NULL }
};
+static struct cli_proto vca_debug_cmds[] = {
+ { "debug.listen_address",
+ "debug.listen_address",
+ "Report the actual listen address\n", 0, 0,
+ ccf_listen_address, NULL },
+ { NULL }
+};
+
void
VCA_Init(void)
{
CLI_AddFuncs(MASTER_CLI, vca_cmds);
+ CLI_AddFuncs(DEBUG_CLI, vca_debug_cmds);
}
void
More information about the varnish-commit
mailing list