Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/patches-2.0'
Browse files Browse the repository at this point in the history
Conflicts:
	bufferevent_openssl.c
  • Loading branch information
nmathewson committed Sep 22, 2012
2 parents 8827dbc + 1acf2eb commit f2050e7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bufferevent_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,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;
Expand All @@ -574,6 +574,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;
Expand Down Expand Up @@ -786,6 +789,9 @@ consider_reading(struct bufferevent_openssl *bev_ssl)
if (r & (OP_BLOCKED|OP_ERR))
break;

if (bev_ssl->bev.read_suspended)
break;

/* Read all pending data. This won't hit the network
* again, and will (most importantly) put us in a state
* where we don't need to read anything else until the
Expand Down

0 comments on commit f2050e7

Please sign in to comment.