]> source.dussan.org Git - rspamd.git/commitdiff
Fix main rspamd worker to work with buffer.c changes.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 7 Nov 2011 17:03:35 +0000 (20:03 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 7 Nov 2011 17:03:35 +0000 (20:03 +0300)
src/main.h
src/worker.c

index fa72c7794062cddc4aef1571c8d8a438489c6602..b7531fa83063a77135c7cebc876277faf913a46c 100644 (file)
@@ -182,7 +182,8 @@ struct worker_task {
                WRITE_REPLY,
                WRITE_ERROR,
                WAIT_FILTER,
-               CLOSING_CONNECTION
+               CLOSING_CONNECTION,
+               WRITING_REPLY
        } state;                                                                                                        /**< current session state                                                      */
        size_t content_length;                                                                          /**< length of user's input                                                     */
        enum rspamd_protocol proto;                                                                     /**< protocol (rspamc or spamc)                                         */
index bd2c5de2e0cc59d2f22c4b5b94a7dbdab0028570..b3e56c13f219f5775afafeb329197ac139727a61 100644 (file)
@@ -349,6 +349,7 @@ write_socket (void *arg)
 
        switch (task->state) {
        case WRITE_REPLY:
+               task->state = WRITING_REPLY;
                if (!write_reply (task)) {
                        return FALSE;
                }
@@ -359,6 +360,7 @@ write_socket (void *arg)
                return FALSE;
                break;
        case WRITE_ERROR:
+               task->state = WRITING_REPLY;
                if (!write_reply (task)) {
                        return FALSE;
                }
@@ -376,6 +378,9 @@ write_socket (void *arg)
                destroy_session (task->s);
                return FALSE;
                break;
+       case WRITING_REPLY:
+               /* Do nothing here */
+               break;
        default:
                msg_info ("abnormally closing connection");
                if (ctx->is_custom) {