on master help sign in
Treat exceeding the concurrency limit as a stream error.
commitea389b1c8213f7d312fa2de0ee198b7340f29e08 authorAndrew Pritchard <awpr@google.com> dateSun 26 Jul 2015, 12:59 (11 years ago) parentf370437
1 file changed+11−2
warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs+11−2
warp/Network/Wai/Handler/Warp/HTTP2/Receiver.hs+11−2
@@ -154,8 +154,17 @@ frameReceiver ctx mkreq recvN = loop `E.catch` sendGoaway
154154 else
155155 writeIORef currentStreamId streamId
156156 cnt <- readIORef concurrency
157− when (cnt >= recommendedConcurrency) $
158− E.throwIO $ ConnectionError RefusedStream "over max concurrency"
157+ when (cnt >= recommendedConcurrency) $ do
158+ -- Record that the stream is closed, rather than
159+ -- idle, so that receiving frames on it is only a
160+ -- stream error.
161+ consume payloadLength
162+ strm <- newStream streamId 0
163+ writeIORef (streamState strm) $ Closed $
164+ ResetByMe $ E.toException $
165+ StreamError RefusedStream streamId
166+ insert streamTable streamId strm
167+ E.throwIO $ StreamError RefusedStream streamId
159168 ws <- initialWindowSize <$> readIORef http2settings
160169 newstrm <- newStream streamId (fromIntegral ws)
161170 when (ftyp == FrameHeaders) $ opened ctx newstrm