aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-01-12 18:04:47 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-01-12 18:04:47 +0300
commit2dd1125642e3fad0390c8477bc1d2084aa59a630 (patch)
treee879cc366ad428ba54b2494e731abd57a94c91c6 /src
parent640b2981e165356ea0609a740cc3e937cf6ab6d5 (diff)
downloadrspamd-2dd1125642e3fad0390c8477bc1d2084aa59a630.tar.gz
rspamd-2dd1125642e3fad0390c8477bc1d2084aa59a630.zip
* Try to fix output from delayed filters processing
Diffstat (limited to 'src')
-rw-r--r--src/filter.c5
-rw-r--r--src/worker.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/filter.c b/src/filter.c
index 64d492e62..290769c54 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -188,6 +188,9 @@ continue_process_filters (struct worker_task *task)
cur = LIST_NEXT (cur, next);
}
/* All done */
+ bufferevent_enable (task->bev, EV_WRITE);
+ evbuffer_drain (task->bev->output, EVBUFFER_LENGTH (task->bev->output));
+ process_statfiles (task);
return 1;
}
}
@@ -439,6 +442,8 @@ process_statfiles (struct worker_task *task)
g_hash_table_destroy (cd.tokens);
g_hash_table_destroy (cd.metrics);
+
+ task->state = WRITE_REPLY;
}
static void
diff --git a/src/worker.c b/src/worker.c
index d18b260b8..bcbea640e 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -18,6 +18,7 @@
#include <perl.h> /* from the Perl distribution */
#include <glib.h>
+#include <event.h>
#include <gmime/gmime.h>
#include "util.h"
@@ -229,7 +230,7 @@ read_socket (struct bufferevent *bev, void *arg)
task->error_code = RSPAMD_FILTER_ERROR;
task->state = WRITE_ERROR;
}
- else if (r == 1) {
+ else if (r == 0) {
task->state = WAIT_FILTER;
}
else {
@@ -239,6 +240,7 @@ read_socket (struct bufferevent *bev, void *arg)
if (task->state == WRITE_ERROR || task->state == WRITE_REPLY) {
bufferevent_enable (bev, EV_WRITE);
bufferevent_disable (bev, EV_READ);
+ evbuffer_drain (bev->output, EVBUFFER_LENGTH (bev->output));
}
}
else {
@@ -334,7 +336,6 @@ start_worker (struct rspamd_worker *worker, int listen_sock)
struct sigaction signals;
int i;
-
worker->srv->pid = getpid ();
worker->srv->type = TYPE_WORKER;
event_init ();