diff options
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r-- | examples/dhtd.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index 553146f7..fdbe7719 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -1369,12 +1369,12 @@ ioToSource !action !onEOF = liftIO action >>= \case | |||
1369 | ioToSource action onEOF | 1369 | ioToSource action onEOF |
1370 | 1370 | ||
1371 | newXmmpSink :: Tox.NetCryptoSession -> C.Sink (Flush Tox.CryptoMessage) IO () | 1371 | newXmmpSink :: Tox.NetCryptoSession -> C.Sink (Flush Tox.CryptoMessage) IO () |
1372 | newXmmpSink session@(Tox.NCrypto { ncOutgoingQueue, ncPacketQueue }) = C.awaitForever $ \flush_cyptomessage -> do | 1372 | newXmmpSink session@(Tox.NCrypto { ncOutgoingQueue = Tox.HaveHandshake outq, ncPacketQueue }) = C.awaitForever $ \flush_cyptomessage -> do |
1373 | let sendit :: Tox.NetCryptoSession -> Flush Tox.CryptoMessage -> IO () | 1373 | let sendit :: Tox.NetCryptoSession -> Flush Tox.CryptoMessage -> IO () |
1374 | sendit session (Chunk msg) = do | 1374 | sendit session (Chunk msg) = do |
1375 | extra <- readyOutGoing ncOutgoingQueue | 1375 | extra <- readyOutGoing outq |
1376 | r <- atomically $ do | 1376 | r <- atomically $ do |
1377 | rTry <- tryAppendQueueOutgoing extra ncOutgoingQueue msg | 1377 | rTry <- tryAppendQueueOutgoing extra outq msg |
1378 | case rTry of | 1378 | case rTry of |
1379 | OGFull -> retry | 1379 | OGFull -> retry |
1380 | OGSuccess -> return OGSuccess | 1380 | OGSuccess -> return OGSuccess |
@@ -1899,7 +1899,8 @@ main = runResourceT $ liftBaseWith $ \resT -> do | |||
1899 | xmppSrc = ioToSource receiveCrypto onEOF | 1899 | xmppSrc = ioToSource receiveCrypto onEOF |
1900 | xmppSink = newXmmpSink netcrypto | 1900 | xmppSink = newXmmpSink netcrypto |
1901 | forM_ msv $ \sv -> do | 1901 | forM_ msv $ \sv -> do |
1902 | announceToxJabberPeer (Tox.ncTheirPublicKey netcrypto) (xmppEventChannel sv) addrTox (Tox.ncSockAddr netcrypto) pingflag xmppSrc xmppSink | 1902 | let Tox.HaveDHTKey saddr = Tox.ncSockAddr netcrypto |
1903 | announceToxJabberPeer (Tox.ncTheirPublicKey netcrypto) (xmppEventChannel sv) addrTox saddr pingflag xmppSrc xmppSink | ||
1903 | -- TODO: Update toxContactInfo, connected. | 1904 | -- TODO: Update toxContactInfo, connected. |
1904 | atomically $ do | 1905 | atomically $ do |
1905 | supply <- readTVar (Tox.listenerIDSupply netCryptoSessionsState) | 1906 | supply <- readTVar (Tox.listenerIDSupply netCryptoSessionsState) |