diff options
author | Daniel Stenberg <daniel@haxx.se> | 2015-09-27 20:48:35 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2015-09-27 20:48:35 +0200 |
commit | 790d6de485154440d4f8822a54641ee00a0d09f3 (patch) | |
tree | c7afacfc653522b8ec67b12ef7228c1b1ee99420 | |
parent | 4f037367ed69b77e14953fe88d8c0497782c0aab (diff) |
readwrite_data: set a max number of loops
... as otherwise a really fast pipe can "lock" one transfer for some
protocols, like with HTTP/2.
-rw-r--r-- | lib/transfer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 191523c8b..7bc500cc8 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -399,6 +399,7 @@ static CURLcode readwrite_data(struct SessionHandle *data, size_t excess = 0; /* excess bytes read */ bool is_empty_data = FALSE; bool readmore = FALSE; /* used by RTP to signal for more data */ + int maxloops = 100; *done = FALSE; @@ -794,7 +795,7 @@ static CURLcode readwrite_data(struct SessionHandle *data, k->keepon &= ~KEEP_RECV; } - } while(data_pending(conn)); + } while(data_pending(conn) && maxloops--); if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) && conn->bits.close ) { |