mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
keyboxd: New getinfo subcommand "connections".
* kbx/kbxserver.c (cmd_getinfo): Add subcommand.
This commit is contained in:
parent
c16604246a
commit
fa2c15634c
@ -745,6 +745,7 @@ static const char hlp_getinfo[] =
|
|||||||
"pid - Return the process id of the server.\n"
|
"pid - Return the process id of the server.\n"
|
||||||
"socket_name - Return the name of the socket.\n"
|
"socket_name - Return the name of the socket.\n"
|
||||||
"session_id - Return the current session_id.\n"
|
"session_id - Return the current session_id.\n"
|
||||||
|
"connections - Return number of active connections.\n"
|
||||||
"getenv NAME - Return value of envvar NAME\n";
|
"getenv NAME - Return value of envvar NAME\n";
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
cmd_getinfo (assuan_context_t ctx, char *line)
|
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));
|
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
|
else
|
||||||
err = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
err = set_error (GPG_ERR_ASS_PARAMETER, "unknown value for WHAT");
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user