From: Vsevolod Stakhov Date: Mon, 19 Jul 2010 15:55:25 +0000 (+0400) Subject: * Handle cases of broken requests X-Git-Tag: 0.3.1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7f25690a5c13c2dc084aab4b5bd7dc8e052332e;p=thirdparty%2Frspamd.git * Handle cases of broken requests --- 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;