From cfaddb2c383a9066f8105245f3459cc1e8ff87d1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 11 Sep 2013 13:15:59 +0100 Subject: [PATCH] Another try to fix skipped messages. --- src/buffer.c | 1 + src/worker.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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); -- 2.39.5