transfer: break the read loop when RECV is cleared

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
This commit is contained in:
Daniel Stenberg 2022-12-28 11:08:44 +01:00
parent 1c00796039
commit 54120efdf6
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -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;
}