mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
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.
This commit is contained in:
parent
4f037367ed
commit
790d6de485
@ -399,6 +399,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
|
|||||||
size_t excess = 0; /* excess bytes read */
|
size_t excess = 0; /* excess bytes read */
|
||||||
bool is_empty_data = FALSE;
|
bool is_empty_data = FALSE;
|
||||||
bool readmore = FALSE; /* used by RTP to signal for more data */
|
bool readmore = FALSE; /* used by RTP to signal for more data */
|
||||||
|
int maxloops = 100;
|
||||||
|
|
||||||
*done = FALSE;
|
*done = FALSE;
|
||||||
|
|
||||||
@ -794,7 +795,7 @@ static CURLcode readwrite_data(struct SessionHandle *data,
|
|||||||
k->keepon &= ~KEEP_RECV;
|
k->keepon &= ~KEEP_RECV;
|
||||||
}
|
}
|
||||||
|
|
||||||
} while(data_pending(conn));
|
} while(data_pending(conn) && maxloops--);
|
||||||
|
|
||||||
if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) &&
|
if(((k->keepon & (KEEP_RECV|KEEP_SEND)) == KEEP_SEND) &&
|
||||||
conn->bits.close ) {
|
conn->bits.close ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user