diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-01 17:48:04 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-08-01 17:48:04 +0400 |
commit | 31ee07b15a645b31618bcaeab0ebee907a60fb70 (patch) | |
tree | a8732b54d0e7f6e4842978b926cbd96c269a533b /src/buffer.c | |
parent | 643576fcff380140d714e6f9711c402246f16a28 (diff) | |
download | rspamd-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.c | 13 |
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 |