Skip to content

Commit

Permalink
transfer: break the read loop when RECV is cleared
Browse files Browse the repository at this point in the history
When the RECV bit is cleared because the response reading for this
transfer is complete, the read loop should be stopped. data_pending()
can otherwise still return TRUE and another read would be attempted.

Reported-by: Hide Ishikawa
Fixes #10172
Closes #10174
  • Loading branch information
bagder committed Dec 30, 2022
1 parent 1c00796 commit 54120ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/transfer.c
Expand Up @@ -776,8 +776,8 @@ static CURLcode readwrite_data(struct Curl_easy *data,
k->keepon &= ~KEEP_RECV;
}

if(k->keepon & KEEP_RECV_PAUSE) {
/* this is a paused transfer */
if((k->keepon & KEEP_RECV_PAUSE) || !(k->keepon & KEEP_RECV)) {
/* this is a paused or stopped transfer */
break;
}

Expand Down

0 comments on commit 54120ef

Please sign in to comment.