Changeset 4369

Show
Ignore:
Timestamp:
11/25/09 11:18:19 (8 months ago)
Author:
phk
Message:

Add a debug.listen_address cli command to report the actual listen
address(es)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/varnish-cache/bin/varnishd/cache_acceptor.c

    r4217 r4369  
    354354} 
    355355 
     356/*--------------------------------------------------------------------*/ 
     357 
     358static void 
     359ccf_listen_address(struct cli *cli, const char * const *av, void *priv) 
     360{ 
     361        struct listen_sock *ls; 
     362        char h[32], p[32]; 
     363 
     364        (void)cli; 
     365        (void)av; 
     366        (void)priv; 
     367        VTAILQ_FOREACH(ls, &heritage.socks, list) { 
     368                if (ls->sock < 0) 
     369                        continue; 
     370                TCP_myname(ls->sock, h, sizeof h, p, sizeof p); 
     371                cli_out(cli, "%s %s\n", h, p); 
     372        } 
     373} 
     374 
     375/*--------------------------------------------------------------------*/ 
     376 
    356377static struct cli_proto vca_cmds[] = { 
    357378        { CLI_SERVER_START,     ccf_start }, 
     
    359380}; 
    360381 
     382static struct cli_proto vca_debug_cmds[] = { 
     383        { "debug.listen_address", 
     384            "debug.listen_address", 
     385            "Report the actual listen address\n", 0, 0, 
     386            ccf_listen_address, NULL }, 
     387        { NULL } 
     388}; 
     389 
    361390void 
    362391VCA_Init(void) 
     
    364393 
    365394        CLI_AddFuncs(MASTER_CLI, vca_cmds); 
     395        CLI_AddFuncs(DEBUG_CLI, vca_debug_cmds); 
    366396} 
    367397