diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-10-31 18:37:41 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-10-31 18:37:41 +0300 |
commit | 98bd93ffddbb1f40884c5c12269948f230dbd0d0 (patch) | |
tree | e2e0595db3dfb373b27c9304b4e81452ba27de6c /src/kvstorage_server.h | |
parent | dee3bdecf7b338ded8df307703e2ebf6be209e30 (diff) | |
download | rspamd-98bd93ffddbb1f40884c5c12269948f230dbd0d0.tar.gz rspamd-98bd93ffddbb1f40884c5c12269948f230dbd0d0.zip |
* Implement basic functionality of key value storage
Diffstat (limited to 'src/kvstorage_server.h')
-rw-r--r-- | src/kvstorage_server.h | 26 |
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); |