aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-01 17:48:04 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-01 17:48:04 +0400
commit31ee07b15a645b31618bcaeab0ebee907a60fb70 (patch)
treea8732b54d0e7f6e4842978b926cbd96c269a533b /src/buffer.c
parent643576fcff380140d714e6f9711c402246f16a28 (diff)
downloadrspamd-31ee07b15a645b31618bcaeab0ebee907a60fb70.tar.gz
rspamd-31ee07b15a645b31618bcaeab0ebee907a60fb70.zip
Fix dispatcher restoration (fix for controller's logic)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c
index bf357d949..666869d51 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -635,16 +635,21 @@ rspamd_dispatcher_sendfile (rspamd_io_dispatcher_t *d, gint fd, size_t len)
void
rspamd_dispatcher_pause (rspamd_io_dispatcher_t * d)
{
+ debug_ip ("paused dispatcher");
event_del (d->ev);
+ d->is_restored = FALSE;
}
void
rspamd_dispatcher_restore (rspamd_io_dispatcher_t * d)
{
- event_del (d->ev);
- event_set (d->ev, d->fd, EV_READ | EV_WRITE, dispatcher_cb, d);
- event_add (d->ev, d->tv);
- d->is_restored = TRUE;
+ if (!d->is_restored) {
+ debug_ip ("restored dispatcher");
+ event_del (d->ev);
+ event_set (d->ev, d->fd, EV_WRITE, dispatcher_cb, d);
+ event_add (d->ev, d->tv);
+ d->is_restored = TRUE;
+ }
}
#undef debug_ip