1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-04 16:45:06 -05:00

http2: fail if connection terminated without END_STREAM

Closes #6736
This commit is contained in:
oxalica 2021-03-12 21:11:08 +08:00 committed by Daniel Stenberg
parent f8a5e9660e
commit d1f40078c1
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1729,6 +1729,17 @@ static ssize_t http2_recv(struct Curl_easy *data, int sockindex,
}
if(nread == 0) {
if(!stream->closed) {
/* This will happen when the server or proxy server is SIGKILLed
during data transfer. We should emit an error since our data
received may be incomplete. */
failf(data, "HTTP/2 stream %d was not closed cleanly before"
" end of the underlying stream",
stream->stream_id);
*err = CURLE_HTTP2_STREAM;
return -1;
}
H2BUGF(infof(data, "end of stream\n"));
*err = CURLE_OK;
return 0;