on master help sign in
Address space leak from exception handlers #649
commitb9e9a09c748e93ba00bd702ed9a44d7ddd0aab9a authorMichael Snoyman <michael@snoyman.com> dateWed 17 Jan 2018, 21:46 (9 years ago) parentdd9f0d2
3 files changed+15−5
warp/ChangeLog.md+5 warp/Network/Wai/Handler/Warp/Run.hs+9−4 warp/warp.cabal+1−1
warp/ChangeLog.md+5
@@ -1,3 +1,8 @@
1+## 3.2.15
2+
3+* Address space leak from exception handlers
4+ [#649](https://github.com/yesodweb/wai/issues/649)
5+
16## 3.2.14
27
38* Support streaming-commons 0.2
warp/Network/Wai/Handler/Warp/Run.hs+9−4
@@ -333,9 +333,14 @@ serveConnection conn ii1 origAddr transport settings app = do
333333 writeIORef istatus True
334334 leftoverSource src bs
335335 addr <- getProxyProtocolAddr src
336− http1 True addr istatus src `E.catch` \e -> do
337− sendErrorResponse addr istatus e
338− throwIO (e :: SomeException)
336+ http1 True addr istatus src `E.catch` \e ->
337+ case fromException e of
338+ -- See comment below referencing
339+ -- https://github.com/yesodweb/wai/issues/618
340+ Just NoKeepAliveRequest -> return ()
341+ Nothing -> do
342+ sendErrorResponse addr istatus e
343+ throwIO e
339344 where
340345 getProxyProtocolAddr src =
341346 case settingsProxyProtocol settings of
@@ -413,7 +418,7 @@ serveConnection conn ii1 origAddr transport settings app = do
413418 -- request headers, no data is available, recvRequest will
414419 -- throw a NoKeepAliveRequest exception, which we catch here
415420 -- and ignore. See: https://github.com/yesodweb/wai/issues/618
416− when keepAlive $ http1 False addr istatus src `E.catch` \NoKeepAliveRequest -> return ()
421+ when keepAlive $ http1 False addr istatus src
417422
418423 processRequest istatus src req mremainingRef idxhdr nextBodyFlush ii = do
419424 -- Let the application run for as long as it wants
warp/warp.cabal+1−1
@@ -1,5 +1,5 @@
11Name: warp
2−Version: 3.2.14
2+Version: 3.2.15
33Synopsis: A fast, light-weight web server for WAI applications.
44License: MIT
55License-file: LICENSE