diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-12-28 11:08:44 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-12-30 09:20:55 +0100 |
commit | 54120efdf64c40c93308dee3935bbed7e1cdc1aa (patch) | |
tree | f9185fbc3c5ce6dbf0b8e37374fa783a9a5ad91a /lib/transfer.c | |
parent | 1c0079603993f6d05a92527a69ed874eb696dc88 (diff) | |
download | curl-54120efdf64c40c93308dee3935bbed7e1cdc1aa.tar.gz |
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
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index e58619a84..58bb8be4c 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -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; } |