From e7ec4dc4dcc484973957c69d15ca8f7aa41aa73e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 15 Mar 2011 16:32:58 +0300 Subject: Add support of uptime command to rspamc. Update manpages. Add script for generating manpages from pod. --- lib/librspamdclient.c | 21 +++++++++++++++++++++ lib/librspamdclient.h | 5 +++++ 2 files changed, 26 insertions(+) (limited to 'lib') diff --git a/lib/librspamdclient.c b/lib/librspamdclient.c index c1143d0be..fa92df208 100644 --- a/lib/librspamdclient.c +++ b/lib/librspamdclient.c @@ -1535,6 +1535,27 @@ rspamd_get_stat (GError **err) return res; } +GString * +rspamd_get_uptime (GError **err) +{ + struct rspamd_connection *c; + GString *res; + static const gchar outcmd[] = "uptime\r\n"; + + g_assert (client != NULL); + + /* Connect to server */ + c = rspamd_connect_random_server (TRUE, err); + + if (c == NULL) { + return NULL; + } + + res = rspamd_send_controller_command (c, outcmd, strlen (outcmd), -1, err); + + return res; +} + /* * Free results */ diff --git a/lib/librspamdclient.h b/lib/librspamdclient.h index 1e7f70187..72b7311a7 100644 --- a/lib/librspamdclient.h +++ b/lib/librspamdclient.h @@ -102,6 +102,11 @@ gboolean rspamd_fuzzy_fd (int fd, const gchar *password, gint weight, gint flag, */ GString *rspamd_get_stat (GError **err); +/* + * Get uptime from server + */ +GString *rspamd_get_uptime (GError **err); + /* * Free results */ -- cgit v1.2.3