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.

(cherry picked from commit 4ba48739673060baea581774992970fa46c2f813)
This commit is contained in:
Greg Hazel 2018-03-20 18:04:53 -07:00 committed by Azat Khuzhin
parent ebfac51797
commit b92b07924d
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -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;