mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
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:
parent
ebfac51797
commit
b92b07924d
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user