aboutsummaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-05 17:58:04 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-10-05 17:58:04 +0400
commit876e5f104227f855269daa0c2812f26a45b38cc7 (patch)
tree68f4f9a405f8613a809c56b08d2253354e548dec /src/worker.c
parentce482fbf8e2c1b9bf0cdba0ab61bc26985ee8977 (diff)
downloadrspamd-876e5f104227f855269daa0c2812f26a45b38cc7.tar.gz
rspamd-876e5f104227f855269daa0c2812f26a45b38cc7.zip
* Add once_received plugin (by dmx)
* Fix read_callback to avoid double freeing of task object
Diffstat (limited to 'src/worker.c')
-rw-r--r--src/worker.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/worker.c b/src/worker.c
index 880da71ab..e246f3213 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -174,7 +174,7 @@ read_socket (f_str_t * in, void *arg)
task->state = WRITE_ERROR;
}
if (task->state == WRITE_REPLY || task->state == WRITE_ERROR) {
- write_socket (task);
+ return write_socket (task);
}
break;
case READ_MESSAGE:
@@ -188,20 +188,19 @@ read_socket (f_str_t * in, void *arg)
task->last_error = "MIME processing error";
task->error_code = RSPAMD_FILTER_ERROR;
task->state = WRITE_ERROR;
- write_socket (task);
+ return write_socket (task);
}
if (task->cmd == CMD_OTHER) {
/* Skip filters */
task->state = WRITE_REPLY;
- write_socket (task);
- return TRUE;
+ return write_socket (task);
}
r = process_filters (task);
if (r == -1) {
task->last_error = "Filter processing error";
task->error_code = RSPAMD_FILTER_ERROR;
task->state = WRITE_ERROR;
- write_socket (task);
+ return write_socket (task);
}
else if (r == 0) {
task->state = WAIT_FILTER;
@@ -209,7 +208,7 @@ read_socket (f_str_t * in, void *arg)
}
else {
process_statfiles (task);
- write_socket (task);
+ return write_socket (task);
}
break;
default: