if (ok && nbytes) {
BEV_RESET_GENERIC_READ_TIMEOUT(bev);
- if (bev->readcb != NULL &&
- evbuffer_get_length(bev->input) >= bev->wm_read.low)
+ _bufferevent_decrement_read_buckets(&bev_a->bev, nbytes);
+ if (evbuffer_get_length(bev->input) >= bev->wm_read.low)
_bufferevent_run_readcb(bev);
bev_async_consider_reading(bev_a);
} else if (!ok) {
if (ok && nbytes) {
BEV_RESET_GENERIC_WRITE_TIMEOUT(bev);
- if (bev->writecb != NULL &&
- evbuffer_get_length(bev->output) <= bev->wm_write.low)
+ _bufferevent_decrement_write_buckets(&bev_a->bev, nbytes);
+ if (evbuffer_get_length(bev->output) <= bev->wm_write.low)
_bufferevent_run_writecb(bev);
bev_async_consider_writing(bev_a);
} else if (!ok) {
if (res <= 0)
goto error;
+ _bufferevent_decrement_read_buckets(bufev_p, res);
/* Invoke the user callback - must always be called last */
- if (evbuffer_get_length(input) >= bufev->wm_read.low &&
- bufev->readcb != NULL)
+ if (evbuffer_get_length(input) >= bufev->wm_read.low)
_bufferevent_run_readcb(bufev);
goto done;