on master help sign in
flipping members.
commit2de0e76c282ff74c9c9a49238c88818e87d1aca7 authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 24 Dec 2015, 14:41 (11 years ago) parent99d2ade
3 files changed+12−8
warp/Network/Wai/Handler/Warp/HTTP2/Sender.hs+3−3 warp/Network/Wai/Handler/Warp/HTTP2/Types.hs+6−2 warp/Network/Wai/Handler/Warp/HTTP2/Worker.hs+3−3
warp/Network/Wai/Handler/Warp/HTTP2/Sender.hs+3−3
@@ -94,7 +94,7 @@ frameSender ctx@Context{outputQ,controlQ,connectionWindow,encodeDynamicTable}
9494 setLimitForEncoding siz dyntbl
9595 loop
9696
97− output out@(ONext strm curr binfo) = do
97+ output out@(ONext strm binfo curr) = do
9898 whenReadyOrEnqueueAgain strm binfo out $ \sws -> do
9999 cws <- atomically $ readTVar connectionWindow
100100 let !lim = min cws sws
@@ -103,7 +103,7 @@ frameSender ctx@Context{outputQ,controlQ,connectionWindow,encodeDynamicTable}
103103 fillDataHeaderSend strm 0 datPayloadLen mnext
104104 maybeEnqueueNext strm mnext binfo
105105 loop
106− output out@(OResponse strm rsp binfo) = do
106+ output out@(OResponse strm binfo rsp) = do
107107 whenReadyOrEnqueueAgain strm binfo out $ \sws -> do
108108 -- Header frame and Continuation frame
109109 let sid = streamNumber strm
@@ -210,7 +210,7 @@ frameSender ctx@Context{outputQ,controlQ,connectionWindow,encodeDynamicTable}
210210 -- Re-enqueue the stream in the output queue.
211211 maybeEnqueueNext :: Stream -> Maybe DynaNext -> BodyInfo -> IO ()
212212 maybeEnqueueNext strm (Just next) binfo = do
213− let !out = ONext strm next binfo
213+ let !out = ONext strm binfo next
214214 enqueueOutput outputQ out
215215 maybeEnqueueNext _ _ _ = return ()
216216
warp/Network/Wai/Handler/Warp/HTTP2/Types.hs+6−2
@@ -51,13 +51,17 @@ type BytesFilled = Int
5151
5252data Next = Next !BytesFilled (Maybe DynaNext)
5353
54−data Output = OResponse !Stream !Response !BodyInfo
55− | ONext !Stream !DynaNext !BodyInfo
54+data Output = OResponse !Stream !BodyInfo !Response
55+ | ONext !Stream !BodyInfo !DynaNext
5656
5757outputStream :: Output -> Stream
5858outputStream (OResponse strm _ _) = strm
5959outputStream (ONext strm _ _) = strm
6060
61+outputBodyInfo :: Output -> BodyInfo
62+outputBodyInfo (OResponse _ binfo _) = binfo
63+outputBodyInfo (ONext _ binfo _) = binfo
64+
6165data Control = CFinish
6266 | CGoaway !ByteString
6367 | CFrame !ByteString
warp/Network/Wai/Handler/Warp/HTTP2/Worker.hs+3−3
@@ -79,7 +79,7 @@ response ii settings Context{outputQ} mgr tconf th strm req rsp
7979 logger req s Nothing
8080 setThreadContinue tconf True
8181 let rsp' = ResponseBuilder s hs bdy
82− out = OResponse strm rsp' binfo
82+ out = OResponse strm binfo rsp'
8383 enqueueOutput outputQ out
8484 return ResponseReceived
8585
@@ -101,7 +101,7 @@ response ii settings Context{outputQ} mgr tconf th strm req rsp
101101 logger req s (filePartByteCount <$> mpart)
102102 setThreadContinue tconf True
103103 let rsp' = ResponseFile s hs path mpart
104− out = OResponse strm rsp' OneshotWithBody
104+ out = OResponse strm OneshotWithBody rsp'
105105 enqueueOutput outputQ out
106106 return ResponseReceived
107107
@@ -125,7 +125,7 @@ response ii settings Context{outputQ} mgr tconf th strm req rsp
125125 -- Since 'StreamingBody' is loop, we cannot control it.
126126 -- So, let's serialize 'Builder' with a designated queue.
127127 sq <- newTBQueueIO 10 -- fixme: hard coding: 10
128− let out = OResponse strm rsp (Persist sq)
128+ let out = OResponse strm (Persist sq) rsp
129129 enqueueOutput outputQ out
130130 let push b = do
131131 atomically $ writeTBQueue sq (SBuilder b)