mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-08 11:53:00 -04:00
Simplify the read high-watermark checking.
This commit is contained in:
parent
c69d5a5d3c
commit
5846bf6cdd
@ -120,17 +120,10 @@ bufferevent_inbuf_wm_cb(struct evbuffer *buf,
|
||||
|
||||
size = evbuffer_get_length(buf);
|
||||
|
||||
if (cbinfo->n_added > cbinfo->n_deleted) {
|
||||
/* Data got added. If it put us over the watermark, stop
|
||||
* reading. */
|
||||
if (size >= bufev->wm_read.high)
|
||||
bufferevent_wm_suspend_read(bufev);
|
||||
} else {
|
||||
/* Data got removed. If it puts us under the watermark,
|
||||
stop reading. */
|
||||
if (size < bufev->wm_read.high)
|
||||
bufferevent_wm_unsuspend_read(bufev);
|
||||
}
|
||||
if (size >= bufev->wm_read.high)
|
||||
bufferevent_wm_suspend_read(bufev);
|
||||
else
|
||||
bufferevent_wm_unsuspend_read(bufev);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user