aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-14 17:48:51 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-14 17:48:51 +0400
commitde262993190d03e40143e83067fb348a33ff9dbd (patch)
treeb8ab7237bb1d7d695ef92eaf17ae90f306fb215e /src/buffer.c
parent8f5fb08857e989193ea30828175f61599512add5 (diff)
downloadrspamd-de262993190d03e40143e83067fb348a33ff9dbd.tar.gz
rspamd-de262993190d03e40143e83067fb348a33ff9dbd.zip
* Add learn_spam/learn_ham interface to librspamdclient and to rspamc
* Improve logic of io dispatcher restoration Remove correction factor from bayes as it leads to classify errors.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c
index ed39d9205..7280c9162 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -463,6 +463,13 @@ dispatcher_cb (gint fd, short what, void *arg)
event_del (d->ev);
event_set (d->ev, fd, EV_READ | EV_PERSIST, dispatcher_cb, (void *)d);
event_add (d->ev, d->tv);
+ if (d->is_restored && d->write_callback) {
+ if (!d->write_callback (d->user_data)) {
+ debug_ip ("callback set wanna_die flag, terminating");
+ return;
+ }
+ d->is_restored = FALSE;
+ }
}
else {
/* Delayed write */
@@ -637,7 +644,9 @@ rspamd_dispatcher_pause (rspamd_io_dispatcher_t * d)
void
rspamd_dispatcher_restore (rspamd_io_dispatcher_t * d)
{
+ event_set (d->ev, d->fd, EV_READ | EV_WRITE, dispatcher_cb, d);
event_add (d->ev, d->tv);
+ d->is_restored = TRUE;
}
#undef debug_ip