http2 5.1.0 → 5.1.1
raw patch · 3 files changed
+25/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +5/−0
- Network/HTTP2/H2/Receiver.hs +19/−8
- http2.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+## 5.1.1++* Deal with RST_STREAM in HalfClosedLocal state+ [#107](https://github.com/kazu-yamamoto/http2/pull/107)+ ## 5.1.0 * Drop frames after reset
Network/HTTP2/H2/Receiver.hs view
@@ -557,21 +557,32 @@ ConnectionErrorIsSent EnhanceYourCalm streamId "too many rst_stream" RSTStreamFrame err <- guardIt $ decodeRSTStreamFrame header bs let cc = Reset err+ closed ctx strm cc - -- The spec mandates (section 8.1):+ -- HTTP2 spec, section 5.1, "Stream States": --- -- > When this is true, a server MAY request that the client abort- -- > transmission of a request without error by sending a RST_STREAM with an- -- > error code of NO_ERROR after sending a complete response (i.e., a frame- -- > with the END_STREAM flag).+ -- > A stream in the "open" state may be used by both peers to send frames+ -- > of any type. (..) From this state, either endpoint can send a frame+ -- > with an END_STREAM flag set, which causes the stream to transition into+ -- > one of the "half-closed" states. An endpoint sending an END_STREAM+ -- > flag causes the stream state to become "half-closed (local)"; an+ -- > endpoint receiving an END_STREAM flag causes the stream state to become+ -- > "half-closed (remote)". --- -- We check the first part ("after sending a complete response") by checking- -- the current stream state.+ -- Crucially (for the specific case we're dealing with here), it continues:+ --+ -- > /Either endpoint/ can send a RST_STREAM frame from this state, causing+ -- > it to transition immediately to "closed".+ --+ -- (emphasis not in original). This justifies the two non-error cases,+ -- below. (Section 8.1 of the spec is also relevant, but it is less explicit+ -- about the /either endpoint/ part.) case (s, err) of+ (Open (Just _) _, NoError) -> -- HalfClosedLocal+ return (Closed cc) (HalfClosedRemote, NoError) -> return (Closed cc) _otherwise -> do- closed ctx strm cc E.throwIO $ StreamErrorIsReceived err streamId -- (No state transition)
http2.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: http2-version: 5.1.0+version: 5.1.1 license: BSD3 license-file: LICENSE maintainer: Kazu Yamamoto <kazu@iij.ad.jp>