mirror of
https://github.com/curl/curl.git
synced 2026-08-05 09:56:26 +03:00
http2: when uploading data from stdin, fix eos forwarding
When uploading data from stdin ('-T -'), and the EOS was only detected
on a 0-length read, the EOS was not forwarded to the filters. This led
HTTP/2 to hang on not forwarding this to the server.
Added test_07_14 to reproduce and verify.
Fixes #14870
Reported-by: nekopsykose on github
Closes #14877
This commit is contained in:
parent
9dc0770e2c
commit
70d3a9b6aa
5 changed files with 68 additions and 18 deletions
|
|
@ -1679,12 +1679,11 @@ static ssize_t req_body_read_callback(nghttp2_session *session,
|
|||
CURL_TRC_CF(data_s, cf, "[%d] req_body_read(len=%zu) eos=%d -> %zd, %d",
|
||||
stream_id, length, stream->body_eos, nread, result);
|
||||
|
||||
if(nread == 0)
|
||||
return NGHTTP2_ERR_DEFERRED;
|
||||
if(stream->body_eos && Curl_bufq_is_empty(&stream->sendbuf))
|
||||
if(stream->body_eos && Curl_bufq_is_empty(&stream->sendbuf)) {
|
||||
*data_flags = NGHTTP2_DATA_FLAG_EOF;
|
||||
|
||||
return nread;
|
||||
return nread;
|
||||
}
|
||||
return (nread == 0)? NGHTTP2_ERR_DEFERRED : nread;
|
||||
}
|
||||
|
||||
#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue