mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:53:39 +03:00
transfer: skip EOS read when download done
When we downloaded all we wanted, and we did not want a response body, and no Trailer: has been announced, and the receive gives EAGAIN, do not hang around unnecessarily. Some servers are buggy in HEAD processing and fail to send the HTTP/2 EOS. Since we do not need any more data, end the request right there. This will cause us to send a RST_STREAM to the server. Fixes #14670 Reported-by: Gruber Glass Closes #14685
This commit is contained in:
parent
1be704e17e
commit
29610e5f3d
3 changed files with 17 additions and 4 deletions
|
|
@ -306,11 +306,18 @@ static CURLcode sendrecv_dl(struct Curl_easy *data,
|
|||
nread = Curl_xfer_recv_resp(data, buf, bytestoread,
|
||||
is_multiplex, &result);
|
||||
if(nread < 0) {
|
||||
if(CURLE_AGAIN == result) {
|
||||
result = CURLE_OK;
|
||||
break; /* get out of loop */
|
||||
if(CURLE_AGAIN != result)
|
||||
goto out; /* real error */
|
||||
result = CURLE_OK;
|
||||
if(data->req.download_done && data->req.no_body &&
|
||||
!data->req.resp_trailer) {
|
||||
DEBUGF(infof(data, "EAGAIN, download done, no trailer announced, "
|
||||
"not waiting for EOS"));
|
||||
nread = 0;
|
||||
/* continue as if we read the EOS */
|
||||
}
|
||||
goto out; /* real error */
|
||||
else
|
||||
break; /* get out of loop */
|
||||
}
|
||||
|
||||
/* We only get a 0-length read on EndOfStream */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue