summaryrefslogtreecommitdiff
path: root/lib/http2.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/http2.c')
-rw-r--r--lib/http2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index c6507e6f6..01322cb01 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;