summaryrefslogtreecommitdiff
path: root/bufferevent_filter.c
diff options
context:
space:
mode:
authorGreg Hazel <ghazel@gmail.com>2018-03-20 18:04:53 -0700
committerAzat Khuzhin <a3at.mail@gmail.com>2018-03-25 22:55:34 +0300
commit4ba48739673060baea581774992970fa46c2f813 (patch)
treeef647c62c992079709a903d11d3ef0b777b29a0e /bufferevent_filter.c
parent4055081499cba32642dd72427a8f9d3ad7e50e79 (diff)
downloadlibevent-4ba48739673060baea581774992970fa46c2f813.tar.gz
don't fail be_null_filter if bytes are copied
Otherwise it will not reset timeouts for the IO, but other things should still works correctly. Also evbuffer_remove_buffer() could return 0, due to empty buffers, for example during flushing bufferevent, so let's count this is BEV_OK too.
Diffstat (limited to 'bufferevent_filter.c')
-rw-r--r--bufferevent_filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bufferevent_filter.c b/bufferevent_filter.c
index 858d4684..a7bdeddd 100644
--- a/bufferevent_filter.c
+++ b/bufferevent_filter.c
@@ -160,7 +160,7 @@ be_null_filter(struct evbuffer *src, struct evbuffer *dst, ev_ssize_t lim,
enum bufferevent_flush_mode state, void *ctx)
{
(void)state;
- if (evbuffer_remove_buffer(src, dst, lim) == 0)
+ if (evbuffer_remove_buffer(src, dst, lim) >= 0)
return BEV_OK;
else
return BEV_ERROR;