mirror of
https://github.com/curl/curl.git
synced 2026-07-31 03:18:03 +03:00
http2: fix EOF handling on uploads with auth negotiation
- doing a POST with `--digest` does an override on the initial request with `Content-Length: 0`, but the http2 filter was unaware of that and expected the originally request body. It did therefore not send a final DATA frame with EOF flag to the server. - The fix overrides any initial notion of post size when the `done_send` event is triggered by the transfer loop, leading to the EOF that is necessary. - refs #11194. The fault did not happen in testing, as Apache httpd never tries to read the request body of the initial request, sends the 401 reply and closes the stream. The server used in the reported issue however tried to read the EOF and timed out on the request. Reported-by: Aleksander Mazur Fixes #11194 Cloes #11200
This commit is contained in:
parent
1fe8de85d3
commit
5c58cb0212
4 changed files with 138 additions and 18 deletions
|
|
@ -1527,10 +1527,8 @@ static CURLcode http2_data_done_send(struct Curl_cfilter *cf,
|
|||
if(!stream->send_closed) {
|
||||
stream->send_closed = TRUE;
|
||||
if(stream->upload_left) {
|
||||
/* If we operated with unknown length, we now know that everything
|
||||
* that is buffered is all we have to send. */
|
||||
if(stream->upload_left == -1)
|
||||
stream->upload_left = Curl_bufq_len(&stream->sendbuf);
|
||||
/* we now know that everything that is buffered is all there is. */
|
||||
stream->upload_left = Curl_bufq_len(&stream->sendbuf);
|
||||
/* resume sending here to trigger the callback to get called again so
|
||||
that it can signal EOF to nghttp2 */
|
||||
(void)nghttp2_session_resume_data(ctx->h2, stream->id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue