diff options
author | joe <joe@jerkface.net> | 2018-05-31 01:11:04 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-05-31 01:11:04 -0400 |
commit | 772cb19a01ce6b32f71ec73026c40749c44115b7 (patch) | |
tree | e11e421358d0816f8e3bd6165bfa46928b3bfeb3 /examples | |
parent | 8633e6288df589e09c2c2ae04dea5a66c9493c56 (diff) |
Avoid using tentative netCryptoSessionsState object.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dhtd.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 09817d4e..65d151ca 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -1661,8 +1661,8 @@ main = runResourceT $ liftBaseWith $ \resT -> do | |||
1661 | 1661 | ||
1662 | keysdb <- Tox.newKeysDatabase | 1662 | keysdb <- Tox.newKeysDatabase |
1663 | 1663 | ||
1664 | crypto <- Tox.newCrypto | 1664 | _crypto <- Tox.newCrypto |
1665 | netCryptoSessionsState <- Tox.newSessionsState crypto Tox.defaultUnRecHook Tox.defaultCryptoDataHooks | 1665 | _netCryptoSessionsState <- Tox.newSessionsState _crypto Tox.defaultUnRecHook Tox.defaultCryptoDataHooks |
1666 | (mbtox,quitTox,toxdhts,toxips,(taddrs::[SockAddr])) <- case porttox opts of | 1666 | (mbtox,quitTox,toxdhts,toxips,(taddrs::[SockAddr])) <- case porttox opts of |
1667 | "" -> return (Nothing,return (), Map.empty, return [],[]) | 1667 | "" -> return (Nothing,return (), Map.empty, return [],[]) |
1668 | toxport -> do | 1668 | toxport -> do |
@@ -1670,7 +1670,7 @@ main = runResourceT $ liftBaseWith $ \resT -> do | |||
1670 | hPutStrLn stderr $ "Supplied key: " ++ show (fmap (Tox.key2id . toPublic) (dhtkey opts)) | 1670 | hPutStrLn stderr $ "Supplied key: " ++ show (fmap (Tox.key2id . toPublic) (dhtkey opts)) |
1671 | tox <- Tox.newTox keysdb | 1671 | tox <- Tox.newTox keysdb |
1672 | addrTox | 1672 | addrTox |
1673 | (Just netCryptoSessionsState) | 1673 | (Just _netCryptoSessionsState) |
1674 | (dhtkey opts) | 1674 | (dhtkey opts) |
1675 | (quitTox, toxStrap4, toxStrap6) <- Tox.forkTox tox | 1675 | (quitTox, toxStrap4, toxStrap6) <- Tox.forkTox tox |
1676 | 1676 | ||
@@ -1855,6 +1855,8 @@ main = runResourceT $ liftBaseWith $ \resT -> do | |||
1855 | , Tox.routing6 $ Tox.toxRouting tox ] | 1855 | , Tox.routing6 $ Tox.toxRouting tox ] |
1856 | return (Just tox, quitTox, dhts, ips, [addrTox]) | 1856 | return (Just tox, quitTox, dhts, ips, [addrTox]) |
1857 | 1857 | ||
1858 | let netCryptoSessionsState = maybe _netCryptoSessionsState Tox.toxCryptoSessions mbtox | ||
1859 | |||
1858 | _ <- UPNP.requestPorts "dht-client" $ map (Datagram,) $ baddrs ++ taddrs | 1860 | _ <- UPNP.requestPorts "dht-client" $ map (Datagram,) $ baddrs ++ taddrs |
1859 | 1861 | ||
1860 | (msv,mconns,mstate) <- case portxmpp opts of | 1862 | (msv,mconns,mstate) <- case portxmpp opts of |