aboutsummaryrefslogtreecommitdiff
path: root/Utility/WebApp.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-06 22:18:58 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-06 22:18:58 -0400
commitbd0e14f5d428a7144626c4a4d58f543fd29e271d (patch)
treebdcb022bb7912ae828fb6e57f0c30193d3c69ab7 /Utility/WebApp.hs
parent6a094efd3bb743118db698fab2c0cc7c502ae55c (diff)
add withSocketsDo to hopefully appease the windows crash report gods
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r--Utility/WebApp.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs
index 4176d418d..225021b2e 100644
--- a/Utility/WebApp.hs
+++ b/Utility/WebApp.hs
@@ -39,6 +39,7 @@ import Control.Concurrent
#ifdef __ANDROID__
import Data.Endian
#endif
+import Network.Socket (withSocketsDo)
localhost :: HostName
localhost = "localhost"
@@ -68,7 +69,7 @@ browserProc url = proc "xdg-open" [url]
- such as start a web browser to view the webapp.
-}
runWebApp :: Maybe HostName -> Wai.Application -> (SockAddr -> IO ()) -> IO ()
-runWebApp h app observer = do
+runWebApp h app observer = withSocketsDo $ do
sock <- getSocket h
void $ forkIO $ runSettingsSocket webAppSettings sock app
sockaddr <- fixSockAddr <$> getSocketName sock