aboutsummaryrefslogtreecommitdiffstats
path: root/src/kvstorage_server.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-31 20:55:54 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-10-31 20:55:54 +0300
commit48e621e0c0fcaa3bbb788147ccd4fc302c6c929b (patch)
treeab4c170ceb7021c0c9f34468987b882ff2c6a705 /src/kvstorage_server.c
parentc750ae5859456d3bc7593e5998deac48cfad7c69 (diff)
downloadrspamd-48e621e0c0fcaa3bbb788147ccd4fc302c6c929b.tar.gz
rspamd-48e621e0c0fcaa3bbb788147ccd4fc302c6c929b.zip
* Significate performance improving by vectorizing IO output (about 4 times for kv storage).
Diffstat (limited to 'src/kvstorage_server.c')
-rw-r--r--src/kvstorage_server.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/kvstorage_server.c b/src/kvstorage_server.c
index 48068cdf7..19a4b3b3d 100644
--- a/src/kvstorage_server.c
+++ b/src/kvstorage_server.c
@@ -355,10 +355,10 @@ kvstorage_read_socket (f_str_t * in, void *arg)
r = rspamd_snprintf (outbuf, sizeof (outbuf), "VALUE %s %ud %ud" CRLF,
elt->key, elt->flags, elt->size);
if (!rspamd_dispatcher_write (session->dispather, outbuf,
- r, FALSE, FALSE)) {
+ r, TRUE, FALSE)) {
return FALSE;
}
- if (!rspamd_dispatcher_write (session->dispather, elt->data, elt->size, FALSE, TRUE)) {
+ if (!rspamd_dispatcher_write (session->dispather, elt->data, elt->size, TRUE, TRUE)) {
return FALSE;
}
return rspamd_dispatcher_write (session->dispather, CRLF "END" CRLF,
@@ -443,9 +443,9 @@ thr_accept_socket (gint fd, short what, void *arg)
g_static_mutex_unlock (thr->accept_mtx);
return;
}
+ g_static_mutex_unlock (thr->accept_mtx);
/* Check for EAGAIN */
if (nfd == 0) {
- g_static_mutex_unlock (thr->accept_mtx);
return;
}
@@ -465,7 +465,6 @@ thr_accept_socket (gint fd, short what, void *arg)
memcpy (&session->client_addr, &su.s4.sin_addr,
sizeof (struct in_addr));
}
- g_static_mutex_unlock (thr->accept_mtx);
}
/**