http2: call the handle-closed function correctly on closed stream

This was this one condition where the stream could be closed due to an
error and the function would still wrongly just return 0 for it.

Reported-by: Gergely Nagy
Fixes #6862
Closes #6910
This commit is contained in:
Daniel Stenberg 2021-04-19 13:13:47 +02:00
parent 6b97f1311a
commit 252790c533
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 4 additions and 0 deletions

View File

@ -1609,6 +1609,10 @@ static ssize_t http2_recv(struct Curl_easy *data, int sockindex,
return -1;
}
if(stream->closed)
/* closed overrides paused */
return http2_handle_stream_close(conn, data, stream, err);
/* Nullify here because we call nghttp2_session_send() and they
might refer to the old buffer. */
stream->upload_mem = NULL;