aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvstorage_server.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvstorage_server.h')
-rw-r--r--src/kvstorage_server.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/kvstorage_server.h b/src/kvstorage_server.h
index 29107101c..6f22b08c2 100644
--- a/src/kvstorage_server.h
+++ b/src/kvstorage_server.h
@@ -27,6 +27,7 @@
#include "config.h"
#include "mem_pool.h"
+#include "buffer.h"
/* Configuration context for kvstorage worker */
struct kvstorage_worker_ctx {
@@ -50,6 +51,31 @@ struct kvstorage_worker_thread {
guint id;
};
+struct kvstorage_session {
+ rspamd_io_dispatcher_t *dispather;
+ enum {
+ KVSTORAGE_STATE_READ_CMD,
+ KVSTORAGE_STATE_READ_DATA
+ } state;
+ enum {
+ KVSTORAGE_CMD_SET,
+ KVSTORAGE_CMD_GET,
+ KVSTORAGE_CMD_DELETE,
+ KVSTORAGE_CMD_QUIT
+ } command;
+ guint id;
+ memory_pool_t *pool;
+ gchar *key;
+ struct kvstorage_config *cf;
+ struct kvstorage_worker_thread *thr;
+ struct in_addr client_addr;
+ gint sock;
+ guint flags;
+ guint expire;
+ guint length;
+ time_t now;
+};
+
gpointer init_kvstorage_worker (void);
void start_kvstorage_worker (struct rspamd_worker *worker);