From: Joachim Bauch Date: Thu, 6 Sep 2012 08:01:10 +0000 (+0200) Subject: No need to reserve space if reading is suspended. X-Git-Tag: release-2.0.21-stable~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1acf2ebcff7769ce63f4b8dfbcc863a273f75a13;p=libevent No need to reserve space if reading is suspended. Conflicts: bufferevent_openssl.c --- diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 06e45110..922ae06c 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -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;