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:
Stefan Eissing 2024-08-26 10:56:28 +02:00 committed by Daniel Stenberg
parent 1be704e17e
commit 29610e5f3d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 17 additions and 4 deletions

View file

@ -3154,6 +3154,11 @@ CURLcode Curl_http_header(struct Curl_easy *data,
}
return CURLE_OK;
}
v = HD_VAL(hd, hdlen, "Trailer:");
if(v) {
data->req.resp_trailer = TRUE;
return CURLE_OK;
}
break;
case 'w':
case 'W':