mirror of
https://github.com/curl/curl.git
synced 2026-05-17 21:16:20 +03:00
HTTP/2: Fix infinite loop in readwrite_data()
To prevent infinite loop in readwrite_data() function when stream is reset before any response body comes, reset closed flag to false once it is evaluated to true.
This commit is contained in:
parent
4d4dd7aea0
commit
67920e1516
1 changed files with 6 additions and 0 deletions
|
|
@ -668,6 +668,9 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
|
|||
(void)sockindex; /* we always do HTTP2 on sockindex 0 */
|
||||
|
||||
if(httpc->closed) {
|
||||
/* Reset to FALSE to prevent infinite loop in readwrite_data
|
||||
function. */
|
||||
httpc->closed = FALSE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -747,6 +750,9 @@ static ssize_t http2_recv(struct connectdata *conn, int sockindex,
|
|||
/* If stream is closed, return 0 to signal the http routine to close
|
||||
the connection */
|
||||
if(httpc->closed) {
|
||||
/* Reset to FALSE to prevent infinite loop in readwrite_data
|
||||
function. */
|
||||
httpc->closed = FALSE;
|
||||
return 0;
|
||||
}
|
||||
*err = CURLE_AGAIN;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue