Skip to content

Commit

Permalink
On multiplex only stop receiving on EOS
Browse files Browse the repository at this point in the history
  • Loading branch information
icing committed Jan 8, 2024
1 parent 595d47e commit 2944e46
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/transfer.c
Expand Up @@ -493,16 +493,13 @@ static CURLcode readwrite_data(struct Curl_easy *data,
if(result || *done)
goto out;

/* If we wrote the EOS, we are definitely done */
if(is_eos) {
k->eos_written = TRUE;
k->download_done = TRUE;
}
/* And if we are done, we stop receiving */
if(k->download_done) {
k->keepon &= ~KEEP_RECV;
/* if we are done, we stop receiving. On multiplexed connections,
* we should read the EOS. Which may arrive as meta data after
* the bytes. Not taking it in might lead to RST of streams. */
if((!is_multiplex && data->req.download_done) || is_eos) {
data->req.keepon &= ~KEEP_RECV;
}
/* And if we are PAUSEd or stopped receiving, we leave the loop */
/* if we are PAUSEd or stopped receiving, leave the loop */
if((k->keepon & KEEP_RECV_PAUSE) || !(k->keepon & KEEP_RECV))
break;

Expand Down Expand Up @@ -1704,9 +1701,5 @@ CURLcode Curl_xfer_write_resp(struct Curl_easy *data,
data->req.eos_written = TRUE;
data->req.download_done = TRUE;
}
/* if we are done, we stop receiving */
if(data->req.download_done) {
data->req.keepon &= ~KEEP_RECV;
}
return result;
}

0 comments on commit 2944e46

Please sign in to comment.