on master help sign in
refactoring.
commitcae497b3806af71227ba62e53091e161d411829e authorKazu Yamamoto <kazu@iij.ad.jp> dateFri 31 Jul 2015, 10:51 (11 years ago) parentaf8dc1f
1 file changed+9−7
warp/Network/Wai/Handler/Warp/HTTP2/Sender.hs+9−7
warp/Network/Wai/Handler/Warp/HTTP2/Sender.hs+9−7
@@ -130,9 +130,10 @@ frameSender ctx@Context{outputQ,connectionWindow}
130130 fillStreamBodyGetNext conn payloadOff lim sq tvar
131131 -- If no data was immediately available, avoid sending an
132132 -- empty data frame.
133− if datPayloadLen > 0
134− then fillDataHeaderSend strm total datPayloadLen mnext
135− else when needSend $ flushN off
133+ if datPayloadLen > 0 then
134+ fillDataHeaderSend strm total datPayloadLen mnext
135+ else
136+ when needSend $ flushN off
136137 maybeEnqueueNext strm mnext pri
137138 loop
138139 switch out@(ONext strm curr) pri = unlessClosed ctx conn strm $ do
@@ -193,10 +194,11 @@ frameSender ctx@Context{outputQ,connectionWindow}
193194 -- Send headers if there is not room for a 1-byte data frame, and return
194195 -- the offset of the next frame's first header byte and whether the headers
195196 -- still need to be sent.
196− sendHeadersIfNecessary total = do
197− if canFitDataFrame total
198− then return (total, True)
199− else bufferIO connWriteBuffer total connSendAll >> return (0, False)
197+ sendHeadersIfNecessary total
198+ | canFitDataFrame total = return (total, True)
199+ | otherwise = do
200+ flushN total
201+ return (0, False)
200202
201203 fillDataHeaderSend strm otherLen datPayloadLen mnext = do
202204 -- Data frame header