mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
keyboxd: New getinfo subcommand "connections".
* kbx/kbxserver.c (cmd_getinfo): Add subcommand.
This commit is contained in:
parent
c16604246a
commit
fa2c15634c
2 changed files with 7 additions and 1 deletions
|
@ -745,6 +745,7 @@ static const char hlp_getinfo[] =
|
|||
"pid - Return the process id of the server.\n"
|
||||
"socket_name - Return the name of the socket.\n"
|
||||
"session_id - Return the current session_id.\n"
|
||||
"connections - Return number of active connections.\n"
|
||||
"getenv NAME - Return value of envvar NAME\n";
|
||||
static gpg_error_t
|
||||
cmd_getinfo (assuan_context_t ctx, char *line)
|
||||
|
@ -792,6 +793,12 @@ cmd_getinfo (assuan_context_t ctx, char *line)
|
|||
err = assuan_send_data (ctx, s, strlen (s));
|
||||
}
|
||||
}
|
||||
else if (!strcmp (line, "connections"))
|
||||
{
|
||||
snprintf (numbuf, sizeof numbuf, "%d",
|
||||
get_kbxd_active_connection_count ());
|
||||
err = assuan_send_data (ctx, numbuf, strlen (numbuf));
|
||||
}
|
||||
else
|
||||
err = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue