From: Vsevolod Stakhov Date: Wed, 11 Sep 2013 12:15:59 +0000 (+0100) Subject: Another try to fix skipped messages. X-Git-Tag: 0.6.0~179 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cfaddb2c383a9066f8105245f3459cc1e8ff87d1;p=rspamd.git Another try to fix skipped messages. --- 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);