Command line use to repeat the problem:
./src/curl --http2 -s https://nghttp2.org https://nghttp2.org --trace-ascii dump --trace-time > /dev/null
I'm attaching a work in progress patch
The cause of stuck is that 1) stream_id does not reset and 2) underlying recv/send functions point to somewhere else.
Patch attached (which modifies the original patch slightly)
Thanks a lot, merged now!