From 82b7e835e44ea4c0662a0bfdb2716f31f95e51d4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 26 Oct 2012 14:38:04 -0400 Subject: [PATCH] run xmpp test in bound thread --- Assistant/Threads/PushNotifier.hs | 2 +- Assistant/WebApp/Configurators/XMPP.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Assistant/Threads/PushNotifier.hs b/Assistant/Threads/PushNotifier.hs index 4ba8d677b4..983f0089d4 100644 --- a/Assistant/Threads/PushNotifier.hs +++ b/Assistant/Threads/PushNotifier.hs @@ -76,7 +76,7 @@ data XMPPCreds = XMPPCreds connectXMPP :: XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ()) connectXMPP c a = case parseJID (xmppJID c) of Nothing -> error "bad JID" - Just jid -> connectXMPP' jid c a + Just jid -> runInBoundThread $ connectXMPP' jid c a {- Do a SRV lookup, but if it fails, fall back to the cached xmppHostname. -} connectXMPP' :: JID -> XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ()) diff --git a/Assistant/WebApp/Configurators/XMPP.hs b/Assistant/WebApp/Configurators/XMPP.hs index 6b38caeae2..bcc712dc14 100644 --- a/Assistant/WebApp/Configurators/XMPP.hs +++ b/Assistant/WebApp/Configurators/XMPP.hs @@ -26,6 +26,7 @@ import Network import Network.Protocol.XMPP import Data.Text (Text) import qualified Data.Text as T +import Control.Concurrent #endif getXMPPR :: Handler RepHtml