Skip to content
Commit 86c633a8 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa Committed by Jay Satiro
Browse files

http2: Ensure that http2_handle_stream_close is called

This commit ensures that streams which was closed in on_stream_close
callback gets passed to http2_handle_stream_close.  Previously, this
might not happen.  To achieve this, we increment drain property to
forcibly call recv function for that stream.

To more accurately check that we have no pending event before shutting
down HTTP/2 session, we sum up drain property into
http_conn.drain_total.  We only shutdown session if that value is 0.

With this commit, when stream was closed before reading response
header fields, error code CURLE_HTTP2_STREAM is returned even if
HTTP/2 level error is NO_ERROR.  This signals the upper layer that
stream was closed by error just like TCP connection close in HTTP/1.

Ref: https://github.com/curl/curl/issues/659
Ref: https://github.com/curl/curl/pull/663
parent b5f82148
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment