distinguishing a single CRLF and a connection close. (#382)
commit02c4883b1a2ce6240cbde4190a5fc593b28f014c
authorKazu Yamamoto <kazu@iij.ad.jp>
dateTue 16 Jun 2015, 12:10 (11 years ago)
parentcd80cb6
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 $ NotEnoughLines []
101+ then throwIO $ ConnectionClosedByPeer
102102 else push src (THStatus 0 id id) bs
103103
104104----------------------------------------------------------------
warp/Network/Wai/Handler/Warp/Run.hs+1−3
@@ -179,9 +179,7 @@ runSettingsConnectionMakerSecure set getConnMaker app = do
179179 f
180180
181181onE :: Settings -> Maybe Request -> SomeException -> IO ()
182−onE set mreq e = case fromException e of
183− Just (NotEnoughLines []) -> return ()
184− _ -> settingsOnException set mreq e
182+onE set mreq e = settingsOnException set mreq e
185183
186184-- Note that there is a thorough discussion of the exception safety of the
187185-- following code at: https://github.com/yesodweb/wai/issues/146