From e7f25690a5c13c2dc084aab4b5bd7dc8e052332e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Jul 2010 19:55:25 +0400 Subject: [PATCH] * Handle cases of broken requests --- src/protocol.c | 6 ++---- src/worker.c | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/protocol.c b/src/protocol.c index f86f256778..cb79b258ce 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -123,7 +123,7 @@ parse_command (struct worker_task *task, f_str_t * line) task->proto_ver = RSPAMC_PROTO_1_1; token = separate_command (line, ' '); if (line == NULL || token == NULL) { - debug_task ("bad command: %s", token); + debug_task ("bad command"); return -1; } @@ -979,9 +979,7 @@ write_reply (struct worker_task *task) debug_task ("writing error: %s", outbuf); } /* Write to bufferevent error message */ - if (! rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE)) { - return FALSE; - } + return rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE); } else { switch (task->cmd) { diff --git a/src/worker.c b/src/worker.c index 8edf2cccee..15b73e2c7f 100644 --- a/src/worker.c +++ b/src/worker.c @@ -351,6 +351,10 @@ read_socket (f_str_t * in, void *arg) return write_socket (task); } break; + case WRITE_REPLY: + case WRITE_ERROR: + return write_socket (task); + break; default: debug_task ("invalid state on reading stage"); break; -- 2.47.3