summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-15 16:32:58 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-03-15 16:32:58 +0300
commite7ec4dc4dcc484973957c69d15ca8f7aa41aa73e (patch)
tree0e44f307e79f537a14b2cc0c6710790c4be788e3 /lib
parent66f91e9ce180f82f11f3256dbd05127fe27de893 (diff)
downloadrspamd-e7ec4dc4dcc484973957c69d15ca8f7aa41aa73e.tar.gz
rspamd-e7ec4dc4dcc484973957c69d15ca8f7aa41aa73e.zip
Add support of uptime command to rspamc.0.3.8
Update manpages. Add script for generating manpages from pod.
Diffstat (limited to 'lib')
-rw-r--r--lib/librspamdclient.c21
-rw-r--r--lib/librspamdclient.h5
2 files changed, 26 insertions, 0 deletions
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
@@ -103,6 +103,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
*/
void rspamd_free_result (struct rspamd_result *result);