on master help sign in
clean up stream resources when websockets completes
commit000a181079a80eaf2f54efbfb8f8a302f106d497 authorAsa Riley <asa@simspace.com> dateMon 16 May 2016, 11:00 (10 years ago) parent007c329
1 file changed+2−1
wai-websockets/Network/Wai/Handler/WebSockets.hs+2−1
wai-websockets/Network/Wai/Handler/WebSockets.hs+2−1
@@ -7,6 +7,7 @@ module Network.Wai.Handler.WebSockets
77 , runWebSockets
88 ) where
99
10+import Control.Exception (finally)
1011import Data.ByteString (ByteString)
1112import qualified Data.ByteString.Char8 as BC
1213import qualified Data.ByteString.Lazy as BL
@@ -110,4 +111,4 @@ runWebSockets opts req app src sink = do
110111 , WS.pendingStream = stream
111112 }
112113
113− app pc
114+ app pc `finally` WS.close stream