mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 04:19:10 -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);
|
size = evbuffer_get_length(buf);
|
||||||
|
|
||||||
if (cbinfo->n_added > cbinfo->n_deleted) {
|
if (size >= bufev->wm_read.high)
|
||||||
/* Data got added. If it put us over the watermark, stop
|
bufferevent_wm_suspend_read(bufev);
|
||||||
* reading. */
|
else
|
||||||
if (size >= bufev->wm_read.high)
|
bufferevent_wm_unsuspend_read(bufev);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user