aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-11 13:15:59 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-09-11 13:15:59 +0100
commitcfaddb2c383a9066f8105245f3459cc1e8ff87d1 (patch)
tree566655281d95622ae2f426d6d4e07ae09fc830b3
parentd218a287788d3040ce5b31e2904641c69c7f49b9 (diff)
downloadrspamd-cfaddb2c383a9066f8105245f3459cc1e8ff87d1.tar.gz
rspamd-cfaddb2c383a9066f8105245f3459cc1e8ff87d1.zip
Another try to fix skipped messages.
-rw-r--r--src/buffer.c1
-rw-r--r--src/worker.c10
2 files changed, 10 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 3d40902f1..2c86b1c9a 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -633,6 +633,7 @@ rspamd_create_dispatcher (struct event_base *base, gint fd, enum io_policy polic
new->strip_eol = TRUE;
new->half_closed = FALSE;
new->want_read = TRUE;
+ new->is_restored = FALSE;
new->ev = memory_pool_alloc0 (new->pool, sizeof (struct event));
new->fd = fd;
diff --git a/src/worker.c b/src/worker.c
index 6974c8018..f27c6c2a9 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -389,6 +389,10 @@ read_socket (f_str_t * in, void *arg)
remove_async_thread (task->s);
}
}
+ if (task->is_skipped) {
+ /* Call write_socket to write reply and exit */
+ return write_socket (task);
+ }
}
else {
lua_call_pre_filters (task);
@@ -475,7 +479,7 @@ write_socket (void *arg)
return write_socket (task);
}
/* Add task to classify to classify pool */
- if (ctx->classify_pool) {
+ if (!task->is_skipped && ctx->classify_pool) {
register_async_thread (task->s);
g_thread_pool_push (ctx->classify_pool, task, &err);
if (err != NULL) {
@@ -483,6 +487,10 @@ write_socket (void *arg)
remove_async_thread (task->s);
}
}
+ if (task->is_skipped) {
+ /* Call write_socket again to write reply and exit */
+ return write_socket (task);
+ }
break;
default:
msg_info ("abnormally closing connection at state: %d", task->state);