]> source.dussan.org Git - rspamd.git/commitdiff
Another try to fix skipped messages.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Sep 2013 12:15:59 +0000 (13:15 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Sep 2013 12:15:59 +0000 (13:15 +0100)
src/buffer.c
src/worker.c

index 3d40902f13c332199a5533a6a465783a9cf665f7..2c86b1c9af85d05019fee42662f6f0e5af6cd228 100644 (file)
@@ -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;
index 6974c8018401f2f1a96fd5c2f6f8790d0c8a8a18..f27c6c2a94d33a4fa8c6b0c2e59c9bb03cd38ada 100644 (file)
@@ -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);