mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 21:34:53 -04:00
No need to reserve space if reading is suspended.
Conflicts: bufferevent_openssl.c
This commit is contained in:
parent
f719b8a918
commit
1acf2ebcff
@ -562,7 +562,7 @@ decrement_buckets(struct bufferevent_openssl *bev_ssl)
|
||||
|
||||
/* Return a bitmask of OP_MADE_PROGRESS (if we read anything); OP_BLOCKED (if
|
||||
we're now blocked); and OP_ERR (if an error occurred). */
|
||||
static int
|
||||
static int
|
||||
do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
|
||||
/* Requires lock */
|
||||
struct bufferevent *bev = &bev_ssl->bev.bev;
|
||||
@ -571,6 +571,9 @@ do_read(struct bufferevent_openssl *bev_ssl, int n_to_read) {
|
||||
struct evbuffer_iovec space[2];
|
||||
int result = 0;
|
||||
|
||||
if (bev_ssl->bev.read_suspended)
|
||||
return 0;
|
||||
|
||||
atmost = _bufferevent_get_read_max(&bev_ssl->bev);
|
||||
if (n_to_read > atmost)
|
||||
n_to_read = atmost;
|
||||
|
Loading…
x
Reference in New Issue
Block a user