mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-14 23:05:03 -04:00
Fix evbuffer_peek() with len==-1 and start_at non-NULL.
This commit is contained in:
parent
4f360f89ca
commit
ba59923ab8
5
buffer.c
5
buffer.c
@ -2742,7 +2742,10 @@ evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len,
|
|||||||
if (n_vec == 0 && len < 0) {
|
if (n_vec == 0 && len < 0) {
|
||||||
/* If no vectors are provided and they asked for "everything",
|
/* If no vectors are provided and they asked for "everything",
|
||||||
* pretend they asked for the actual available amount. */
|
* pretend they asked for the actual available amount. */
|
||||||
len = buffer->total_len - len_so_far;
|
len = buffer->total_len;
|
||||||
|
if (start_at) {
|
||||||
|
len -= start_at->pos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (chain) {
|
while (chain) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user