gnutls segfault fixed

Adjust build deps to ensure that only a fixed version of the library will
be used.

Also, removed the bound thread stuff, which I now think was (probably)
a red herring.
This commit is contained in:
Joey Hess 2012-10-26 23:07:30 -04:00
parent d1e5f2d596
commit 0c0ef99341
5 changed files with 8 additions and 11 deletions

View file

@ -216,17 +216,15 @@ startAssistant assistant daemonize webappwaiter = withThreadState $ \st -> do
, assist $ transferScannerThread st dstatus scanremotes transferqueue , assist $ transferScannerThread st dstatus scanremotes transferqueue
, assist $ configMonitorThread st dstatus branchhandle commitchan , assist $ configMonitorThread st dstatus branchhandle commitchan
#ifdef WITH_XMPP #ifdef WITH_XMPP
{- Bound thread, because TLS needs it. -} , assist $ pushNotifierThread st dstatus pushnotifier
, bound $ assist $ pushNotifierThread st dstatus pushnotifier
#endif #endif
, watch $ watchThread st dstatus transferqueue changechan , watch $ watchThread st dstatus transferqueue changechan
] ]
waitForTermination waitForTermination
watch a = (forkIO, True, a) watch a = (True, a)
assist a = (forkIO, False, a) assist a = (False, a)
bound (_, watcher, t) = (forkOS, watcher, t)
startthread dstatus (runner, watcher, t) startthread dstatus (runner, watcher, t)
| watcher || assistant = void $ runner $ | watcher || assistant = void $ forkIO $
runNamedThread dstatus t runNamedThread dstatus t
| otherwise = noop | otherwise = noop

View file

@ -35,7 +35,7 @@ pushNotifierThread st dstatus pushnotifier = NamedThread thisThread $ do
fulljid <- bindJID jid fulljid <- bindJID jid
liftIO $ debug thisThread ["XMPP connected", show fulljid] liftIO $ debug thisThread ["XMPP connected", show fulljid]
s <- getSession s <- getSession
_ <- liftIO $ forkOS $ void $ runXMPP s $ _ <- liftIO $ forkIO $ void $ runXMPP s $
receivenotifications receivenotifications
sendnotifications sendnotifications
where where

View file

@ -28,11 +28,10 @@ data XMPPCreds = XMPPCreds
} }
deriving (Read, Show) deriving (Read, Show)
{- Note that this must be run in a bound thread; gnuTLS requires it. -}
connectXMPP :: XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ()) connectXMPP :: XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ())
connectXMPP c a = case parseJID (xmppJID c) of connectXMPP c a = case parseJID (xmppJID c) of
Nothing -> error "bad JID" Nothing -> error "bad JID"
Just jid -> runInBoundThread $ connectXMPP' jid c a Just jid -> connectXMPP' jid c a
{- Do a SRV lookup, but if it fails, fall back to the cached xmppHostname. -} {- Do a SRV lookup, but if it fails, fall back to the cached xmppHostname. -}
connectXMPP' :: JID -> XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ()) connectXMPP' :: JID -> XMPPCreds -> (JID -> XMPP a) -> IO (Either SomeException ())

2
debian/control vendored
View file

@ -40,7 +40,7 @@ Build-Depends:
libghc-network-multicast-dev, libghc-network-multicast-dev,
libghc-network-info-dev, libghc-network-info-dev,
libghc-safesemaphore-dev, libghc-safesemaphore-dev,
libghc-network-protocol-xmpp-dev, libghc-network-protocol-xmpp-dev (>= 0.4.3-2),
ikiwiki, ikiwiki,
perlmagick, perlmagick,
git, git,

View file

@ -98,7 +98,7 @@ Executable git-annex
CPP-Options: -DWITH_PAIRING CPP-Options: -DWITH_PAIRING
if flag(XMPP) && flag(Assistant) if flag(XMPP) && flag(Assistant)
Build-Depends: network-protocol-xmpp Build-Depends: network-protocol-xmpp, gnutls (>= 0.1.4)
CPP-Options: -DWITH_XMPP CPP-Options: -DWITH_XMPP
if flag(XMPP) && flag(Assistant) && flag(Adns) if flag(XMPP) && flag(Assistant) && flag(Adns)