No need to reserve space if reading is suspended.

Conflicts:
	bufferevent_openssl.c
This commit is contained in:
Joachim Bauch 2012-09-06 10:01:10 +02:00 committed by Nick Mathewson
parent f719b8a918
commit 1acf2ebcff

View File

@ -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;