@@ -130,9 +130,10 @@ frameSender ctx@Context{outputQ,connectionWindow}
130 fillStreamBodyGetNext conn payloadOff lim sq tvar
130 fillStreamBodyGetNext conn payloadOff lim sq tvar
131 -- If no data was immediately available, avoid sending an
131 -- If no data was immediately available, avoid sending an
132 -- empty data frame.
132 -- empty data frame.
133− if datPayloadLen > 0
133+ if datPayloadLen > 0 then
134− then fillDataHeaderSend strm total datPayloadLen mnext
134+ fillDataHeaderSend strm total datPayloadLen mnext
135− else when needSend $ flushN off
136+ when needSend $ flushN off
136 maybeEnqueueNext strm mnext pri
137 maybeEnqueueNext strm mnext pri
138 switch out@(ONext strm curr) pri = unlessClosed ctx conn strm $ do
139 switch out@(ONext strm curr) pri = unlessClosed ctx conn strm $ do
@@ -193,10 +194,11 @@ frameSender ctx@Context{outputQ,connectionWindow}
193 -- Send headers if there is not room for a 1-byte data frame, and return
194 -- Send headers if there is not room for a 1-byte data frame, and return
194 -- the offset of the next frame's first header byte and whether the headers
195 -- the offset of the next frame's first header byte and whether the headers
195 -- still need to be sent.
196 -- still need to be sent.
196− sendHeadersIfNecessary total = do
197+ sendHeadersIfNecessary total
197− if canFitDataFrame total
198+ | canFitDataFrame total = return (total, True)
198− then return (total, True)
199+ | otherwise = do
199− else bufferIO connWriteBuffer total connSendAll >> return (0, False)
200+ flushN total
201 fillDataHeaderSend strm otherLen datPayloadLen mnext = do
203 fillDataHeaderSend strm otherLen datPayloadLen mnext = do
202 -- Data frame header
204 -- Data frame header