diff options
author | Greg Hazel <ghazel@gmail.com> | 2018-03-20 18:04:53 -0700 |
---|---|---|
committer | Azat Khuzhin <a3at.mail@gmail.com> | 2018-03-25 22:55:34 +0300 |
commit | 4ba48739673060baea581774992970fa46c2f813 (patch) | |
tree | ef647c62c992079709a903d11d3ef0b777b29a0e /bufferevent_filter.c | |
parent | 4055081499cba32642dd72427a8f9d3ad7e50e79 (diff) | |
download | libevent-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.c | 2 |
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; |