diff options
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r-- | examples/dhtd.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index c0330657..f54c5249 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -353,6 +353,7 @@ data Session = Session | |||
353 | , dhts :: Map.Map String DHT | 353 | , dhts :: Map.Map String DHT |
354 | , externalAddresses :: IO [SockAddr] | 354 | , externalAddresses :: IO [SockAddr] |
355 | , swarms :: Mainline.SwarmsDatabase | 355 | , swarms :: Mainline.SwarmsDatabase |
356 | , cryptosessions :: Tox.NetCryptoSessions | ||
356 | , toxkeys :: TVar Tox.AnnouncedKeys | 357 | , toxkeys :: TVar Tox.AnnouncedKeys |
357 | , userkeys :: TVar [(SecretKey,PublicKey)] | 358 | , userkeys :: TVar [(SecretKey,PublicKey)] |
358 | , roster :: Roster | 359 | , roster :: Roster |
@@ -947,12 +948,13 @@ main = do | |||
947 | 948 | ||
948 | keysdb <- Tox.newKeysDatabase | 949 | keysdb <- Tox.newKeysDatabase |
949 | 950 | ||
951 | crypto <- Tox.newCrypto | ||
952 | netCryptoSessionsState <- Tox.newSessionsState crypto Tox.defaultUnRecHook Tox.defaultCryptoDataHooks | ||
953 | |||
950 | (mbtox,quitTox,toxdhts,toxips,taddrs) <- case porttox opts of | 954 | (mbtox,quitTox,toxdhts,toxips,taddrs) <- case porttox opts of |
951 | "" -> return (Nothing,return (), Map.empty, return [],[]) | 955 | "" -> return (Nothing,return (), Map.empty, return [],[]) |
952 | toxport -> do | 956 | toxport -> do |
953 | addrTox <- getBindAddress toxport (ip6tox opts) | 957 | addrTox <- getBindAddress toxport (ip6tox opts) |
954 | crypto <- Tox.newCrypto | ||
955 | netCryptoSessionsState <- Tox.newSessionsState crypto Tox.defaultUnRecHook Tox.defaultCryptoDataHooks | ||
956 | tox <- Tox.newTox keysdb addrTox (Just netCryptoSessionsState) | 958 | tox <- Tox.newTox keysdb addrTox (Just netCryptoSessionsState) |
957 | quitTox <- Tox.forkTox tox | 959 | quitTox <- Tox.forkTox tox |
958 | 960 | ||
@@ -1133,6 +1135,7 @@ main = do | |||
1133 | , dhts = dhts -- all DHTs | 1135 | , dhts = dhts -- all DHTs |
1134 | , signalQuit = signalQuit | 1136 | , signalQuit = signalQuit |
1135 | , swarms = swarms | 1137 | , swarms = swarms |
1138 | , cryptosessions = netCryptoSessionsState | ||
1136 | , toxkeys = keysdb | 1139 | , toxkeys = keysdb |
1137 | , userkeys = toxids | 1140 | , userkeys = toxids |
1138 | , roster = rstr | 1141 | , roster = rstr |