From: oxalica Date: Fri, 12 Mar 2021 13:11:08 +0000 (+0800) Subject: http2: fail if connection terminated without END_STREAM X-Git-Tag: curl-7_76_0~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1f40078c13e85c56332dcb7f908fe2a7b65eb22;p=thirdparty%2Fcurl.git http2: fail if connection terminated without END_STREAM Closes #6736 --- diff --git a/lib/http2.c b/lib/http2.c index c6507e6f63..01322cb013 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -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;