on master help sign in
hlint hack.
commitb28862ab79f55e9aeedcec5b367f3c66a176a411 authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 25 Jun 2015, 13:52 (11 years ago) parent1fc3e11
4 files changed+8−9
warp/Network/Wai/Handler/Warp/Recv.hs+1−2 warp/Network/Wai/Handler/Warp/Request.hs+1−1 warp/Network/Wai/Handler/Warp/Response.hs+4−4 warp/Network/Wai/Handler/Warp/Run.hs+2−2
warp/Network/Wai/Handler/Warp/Recv.hs+1−2
@@ -30,8 +30,7 @@ receive :: Socket -> BufferPool -> IO ByteString
3030receive sock pool = withBufferPool pool $ \ (ptr, size) -> do
3131 let sock' = fdSocket sock
3232 size' = fromIntegral size
33− received <- fromIntegral <$> receiveloop sock' ptr size'
34− return received
33+ fromIntegral <$> receiveloop sock' ptr size'
3534
3635receiveloop :: CInt -> Ptr Word8 -> CSize -> IO CInt
3736receiveloop sock ptr size = do
warp/Network/Wai/Handler/Warp/Request.hs+1−1
@@ -98,7 +98,7 @@ headerLines :: Source -> IO [ByteString]
9898headerLines src = do
9999 bs <- readSource src
100100 if S.null bs
101− then throwIO $ ConnectionClosedByPeer
101+ then throwIO ConnectionClosedByPeer
102102 else push src (THStatus 0 id id) bs
103103
104104----------------------------------------------------------------
warp/Network/Wai/Handler/Warp/Response.hs+4−4
@@ -200,7 +200,7 @@ sendResponse defServer conn ii req reqidxhdr src response = do
200200 addServerAndDate = addDate dc rspidxhdr . addServer defServer rspidxhdr
201201 mRange = reqidxhdr ! idxRange
202202 (isPersist,isChunked0) = infoFromRequest req reqidxhdr
203− isChunked = if isHead then False else isChunked0
203+ isChunked = not isHead && isChunked0
204204 (isKeepAlive, needsChunked) = infoFromResponse rspidxhdr (isPersist,isChunked)
205205 isHead = requestMethod req == H.methodHead
206206 rsp = case response of
@@ -257,7 +257,7 @@ sendRsp conn mfdc ver s0 hs0 (RspFile path mPart mRange isHead hook) = do
257257 let fid = FileId path mfd
258258#endif
259259 connSendFile conn fid beg len hook' [lheader]
260− | otherwise -> do
260+ | otherwise ->
261261 sendRsp conn mfdc ver H.status416
262262 (filter (\(k, _) -> k /= "content-length") hs1)
263263 (RspBuilder mempty True)
@@ -405,9 +405,9 @@ addContentRange beg end total hdrs = (hContentRange, range) : hdrs
405405 -- building with ShowS
406406 $ 'b' : 'y': 't' : 'e' : 's' : ' '
407407 : (if beg > end then ('*':) else
408− (showInt beg)
408+ showInt beg
409409 . ('-' :)
410− . (showInt end))
410+ . showInt end)
411411 ( '/'
412412 : showInt total "")
413413
warp/Network/Wai/Handler/Warp/Run.hs+2−2
@@ -203,7 +203,7 @@ acceptConnection set getConnMaker app dc fc tm counter = do
203203 -- First mask all exceptions in acceptLoop. This is necessary to
204204 -- ensure that no async exception is throw between the call to
205205 -- acceptNewConnection and the registering of connClose.
206− void $ mask_ $ acceptLoop
206+ void $ mask_ acceptLoop
207207 gracefulShutdown counter
208208 where
209209 acceptLoop = do
@@ -403,7 +403,7 @@ serveConnection conn ii origAddr transport settings app = do
403403
404404 if not keepAlive then
405405 return False
406− else do
406+ else
407407 -- If there is an unknown or large amount of data to still be read
408408 -- from the request body, simple drop this connection instead of
409409 -- reading it all in to satisfy a keep-alive request.