http2: fix responses to long payload reqs
When a request with a long payload is received, http2 does not allow a response that does not process all the incoming payload if the payload exceeds the initial window size. Add a conditional Http2Stream#close
call that runs only if its a server-side stream, the user hasn't attempted to read the stream & there is no resume call scheduled.
With all that said, I hope someone has some good ideas that will make this less of a monster...
Also, FWIW this should make writes slightly less brittle because right now it's possible to trigger a follow-up write from the Done
callback which would then trigger the assert in SendPendingData
. In particular this tends to happen when using either destroy
or close
on a stream.
Fixes: https://github.com/nodejs/node/issues/20060
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines