aboutsummaryrefslogtreecommitdiffstats
path: root/src/protocol.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-06 16:48:19 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-06 16:48:19 +0100
commit5c9b94462f0e32d951fa319428dc8c1a8baa54a0 (patch)
tree5c75eb4e3eddf69c299392763a9c5ad47370da14 /src/protocol.c
parent44fbf9709b76d89db14f8dba0cc7ca15fb3e7954 (diff)
downloadrspamd-5c9b94462f0e32d951fa319428dc8c1a8baa54a0.tar.gz
rspamd-5c9b94462f0e32d951fa319428dc8c1a8baa54a0.zip
Allow parsing streams without Content-Length.
Diffstat (limited to 'src/protocol.c')
-rw-r--r--src/protocol.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c
index ffc56bde6..bb66f29d4 100644
--- a/src/protocol.c
+++ b/src/protocol.c
@@ -445,8 +445,14 @@ parse_header (struct worker_task *task, f_str_t * line)
else {
rspamd_set_dispatcher_policy (task->dispatcher, BUFFER_CHARACTER, task->content_length);
task->state = READ_MESSAGE;
+ task->msg = memory_pool_alloc0 (task->task_pool, sizeof (f_str_t));
}
}
+ else if (task->cmd != CMD_LEARN && task->cmd != CMD_OTHER) {
+ rspamd_set_dispatcher_policy (task->dispatcher, BUFFER_ANY, 0);
+ task->state = READ_MESSAGE;
+ task->msg = memory_pool_alloc0 (task->task_pool, sizeof (f_str_t));
+ }
else {
task->last_error = "Unknown content length";
task->error_code = RSPAMD_LENGTH_ERROR;