Hello community, here is the log from the commit of package ghc-warp for openSUSE:Factory checked in at 2017-03-20 17:08:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-warp (Old) and /work/SRC/openSUSE:Factory/.ghc-warp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-warp" Mon Mar 20 17:08:07 2017 rev:11 rq:477470 version:3.2.11.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-warp/ghc-warp.changes 2017-02-21 13:46:02.336774970 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-warp.new/ghc-warp.changes 2017-03-20 17:08:09.585756687 +0100 @@ -1,0 +2,5 @@ +Mon Feb 27 10:12:20 UTC 2017 - [email protected] + +- Update to version 3.2.11.1 with cabal2obs. + +------------------------------------------------------------------- Old: ---- warp-3.2.11.tar.gz New: ---- warp-3.2.11.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-warp.spec ++++++ --- /var/tmp/diff_new_pack.om6Fli/_old 2017-03-20 17:08:10.545621155 +0100 +++ /var/tmp/diff_new_pack.om6Fli/_new 2017-03-20 17:08:10.549620590 +0100 @@ -19,7 +19,7 @@ %global pkg_name warp %bcond_with tests Name: ghc-%{pkg_name} -Version: 3.2.11 +Version: 3.2.11.1 Release: 0 Summary: A fast, light-weight web server for WAI applications License: MIT ++++++ warp-3.2.11.tar.gz -> warp-3.2.11.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/warp-3.2.11/ChangeLog.md new/warp-3.2.11.1/ChangeLog.md --- old/warp-3.2.11/ChangeLog.md 2017-02-02 02:57:32.000000000 +0100 +++ new/warp-3.2.11.1/ChangeLog.md 2017-02-24 13:00:12.000000000 +0100 @@ -1,3 +1,8 @@ +## 3.2.11.1 + +* Move exception handling to top of thread (fixes + [#613](https://github.com/yesodweb/wai/issues/613)) + ## 3.2.11 * Fixing 10 HTTP2 bugs pointed out by h2spec v2. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/warp-3.2.11/Network/Wai/Handler/Warp/Run.hs new/warp-3.2.11.1/Network/Wai/Handler/Warp/Run.hs --- old/warp-3.2.11/Network/Wai/Handler/Warp/Run.hs 2017-02-02 02:57:32.000000000 +0100 +++ new/warp-3.2.11.1/Network/Wai/Handler/Warp/Run.hs 2017-02-24 13:00:12.000000000 +0100 @@ -263,45 +263,24 @@ -> Counter -> InternalInfo0 -> IO () -fork set mkConn addr app counter ii0 = settingsFork set $ \ unmask -> +fork set mkConn addr app counter ii0 = settingsFork set $ \unmask -> + -- Call the user-supplied on exception code if any + -- exceptions are thrown. + handle (settingsOnException set Nothing) . -- Allocate a new IORef indicating whether the connection has been -- closed, to avoid double-freeing a connection withClosedRef $ \ref -> - - -- Run the connection maker to get a new connection, and ensure - -- that the connection is closed. If the mkConn call throws an - -- exception, we will leak the connection. If the mkConn call is - -- vulnerable to attacks (e.g., Slowloris), we do nothing to - -- protect the server. It is therefore vital that mkConn is well - -- vetted. - -- - -- We grab the connection before registering timeouts since the - -- timeouts will be useless during connection creation, due to the - -- fact that async exceptions are still masked. - bracket mkConn (\(conn, _) -> closeConn ref conn `finally` connFree conn) - $ \(conn, transport) -> - - -- We need to register a timeout handler for this thread, and - -- cancel that handler as soon as we exit. We additionally close - -- the connection immediately in case the child thread catches the - -- async exception or performs some long-running cleanup action. - bracket (T.registerKillThread (timeoutManager0 ii0) (closeConn ref conn)) T.cancel $ \th -> - - let ii1 = toInternalInfo1 ii0 th - -- We now have fully registered a connection close handler - -- in the case of all exceptions, so it is safe to one - -- again allow async exceptions. - in unmask . - -- Call the user-supplied on exception code if any - -- exceptions are thrown. - handle (settingsOnException set Nothing) . - - -- Call the user-supplied code for connection open and close events - bracket (onOpen addr) (onClose addr) $ \goingon -> - - -- Actually serve this connection. - -- bracket with closeConn above ensures the connection is closed. - when goingon $ serveConnection conn ii1 addr transport set app + -- Run the connection maker to get a new connection, and ensure + -- that the connection is closed. If the mkConn call throws an + -- exception, we will leak the connection. If the mkConn call is + -- vulnerable to attacks (e.g., Slowloris), we do nothing to + -- protect the server. It is therefore vital that mkConn is well + -- vetted. + -- + -- We grab the connection before registering timeouts since the + -- timeouts will be useless during connection creation, due to the + -- fact that async exceptions are still masked. + bracket mkConn (cleanUp ref) (serve unmask ref) where withClosedRef inner = newIORef False >>= inner @@ -309,6 +288,29 @@ isClosed <- atomicModifyIORef' ref $ \x -> (True, x) unless isClosed $ connClose conn + cleanUp ref (conn, _) = closeConn ref conn `finally` connFree conn + + -- We need to register a timeout handler for this thread, and + -- cancel that handler as soon as we exit. We additionally close + -- the connection immediately in case the child thread catches the + -- async exception or performs some long-running cleanup action. + serve unmask ref (conn, transport) = bracket register cancel $ \th -> do + let ii1 = toInternalInfo1 ii0 th + -- We now have fully registered a connection close handler in + -- the case of all exceptions, so it is safe to one again + -- allow async exceptions. + unmask . + -- Call the user-supplied code for connection open and + -- close events + bracket (onOpen addr) (onClose addr) $ \goingon -> + -- Actually serve this connection. bracket with closeConn + -- above ensures the connection is closed. + when goingon $ serveConnection conn ii1 addr transport set app + where + register = T.registerKillThread (timeoutManager0 ii0) + (closeConn ref conn) + cancel = T.cancel + onOpen adr = increase counter >> settingsOnOpen set adr onClose adr _ = decrease counter >> settingsOnClose set adr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/warp-3.2.11/warp.cabal new/warp-3.2.11.1/warp.cabal --- old/warp-3.2.11/warp.cabal 2017-02-02 02:57:32.000000000 +0100 +++ new/warp-3.2.11.1/warp.cabal 2017-02-24 13:00:12.000000000 +0100 @@ -1,5 +1,5 @@ Name: warp -Version: 3.2.11 +Version: 3.2.11.1 Synopsis: A fast, light-weight web server for WAI applications. License: MIT License-file: LICENSE
