diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-11-01 21:39:54 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-11-01 21:39:54 +0300 |
commit | b50b716c78c39249e15b92132e2ee9d75639be17 (patch) | |
tree | e93e1df788f214783cf6b71b3a7d5bbbb7386186 /src/kvstorage_server.c | |
parent | 323cc58a8819d8356562bbc2de55d4ef920b22cc (diff) | |
download | rspamd-b50b716c78c39249e15b92132e2ee9d75639be17.tar.gz rspamd-b50b716c78c39249e15b92132e2ee9d75639be17.zip |
Store keys inside elements.
Diffstat (limited to 'src/kvstorage_server.c')
-rw-r--r-- | src/kvstorage_server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/kvstorage_server.c b/src/kvstorage_server.c index afdc8b163..50497f919 100644 --- a/src/kvstorage_server.c +++ b/src/kvstorage_server.c @@ -353,12 +353,12 @@ kvstorage_read_socket (f_str_t * in, void *arg) } else { r = rspamd_snprintf (outbuf, sizeof (outbuf), "VALUE %s %ud %ud" CRLF, - elt->key, elt->flags, elt->size); + ELT_KEY (elt), elt->flags, elt->size); if (!rspamd_dispatcher_write (session->dispather, outbuf, r, TRUE, FALSE)) { return FALSE; } - if (!rspamd_dispatcher_write (session->dispather, elt->data, elt->size, TRUE, TRUE)) { + if (!rspamd_dispatcher_write (session->dispather, ELT_DATA(elt), elt->size, TRUE, TRUE)) { return FALSE; } return rspamd_dispatcher_write (session->dispather, CRLF "END" CRLF, @@ -371,7 +371,7 @@ kvstorage_read_socket (f_str_t * in, void *arg) if (elt != NULL) { if ((elt->flags & KV_ELT_DIRTY) == 0) { /* Free memory if backend has deleted this element */ - g_slice_free1 (elt->size + sizeof (struct rspamd_kv_element), elt); + g_slice_free1 (ELT_SIZE (elt), elt); } g_static_rw_lock_writer_unlock (&session->cf->storage->rwlock); return rspamd_dispatcher_write (session->dispather, "DELETED" CRLF, |