summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Network/Tox.hs2
-rw-r--r--src/Network/Tox/Crypto/Handlers.hs3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Network/Tox.hs b/src/Network/Tox.hs
index 79bd68ac..87835769 100644
--- a/src/Network/Tox.hs
+++ b/src/Network/Tox.hs
@@ -314,7 +314,7 @@ newTox keydb addr = do
314 { toxDHT = dhtclient 314 { toxDHT = dhtclient
315 , toxOnion = onionclient 315 , toxOnion = onionclient
316 , toxToRoute = onInbound (updateRoster roster) dtacrypt 316 , toxToRoute = onInbound (updateRoster roster) dtacrypt
317 , toxCrypto = addHandler (reportParseError $ printErrors stderr) (cryptoNetHandler sessionsState) cryptonet 317 , toxCrypto = addHandler (hPutStrLn stderr) (cryptoNetHandler sessionsState) cryptonet
318 , toxCryptoKeys = crypto 318 , toxCryptoKeys = crypto
319 , toxRouting = routing 319 , toxRouting = routing
320 , toxTokens = toks 320 , toxTokens = toks
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs
index f2c792cd..29f55e54 100644
--- a/src/Network/Tox/Crypto/Handlers.hs
+++ b/src/Network/Tox/Crypto/Handlers.hs
@@ -46,6 +46,7 @@ data HandshakeParams
46newHandShakeData :: TransportCrypto -> HandshakeParams -> HandshakeData 46newHandShakeData :: TransportCrypto -> HandshakeParams -> HandshakeData
47newHandShakeData = error "todo" 47newHandShakeData = error "todo"
48 48
49cryptoNetHandler :: NetCryptoSessions -> SockAddr -> NetCrypto -> IO (Maybe (NetCrypto -> NetCrypto))
49cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) nonce24 encrypted)) = do 50cryptoNetHandler sessions addr (NetHandshake (Handshake (Cookie n24 ecookie) nonce24 encrypted)) = do
50 let crypto = transportCrypto sessions 51 let crypto = transportCrypto sessions
51 allsessions = netCryptoSessions sessions 52 allsessions = netCryptoSessions sessions
@@ -122,4 +123,4 @@ cryptoNetHandler sessions addr (NetCrypto (CryptoPacket nonce16 encrypted)) = do
122 -- Handle Encrypted Message 123 -- Handle Encrypted Message
123 -- TODO 124 -- TODO
124 return Nothing 125 return Nothing
125cryptoNetHandlerr _ _ _ = return id 126-- cryptoNetHandler _ _ _ = return $ Just id