summaryrefslogtreecommitdiff
path: root/src/Network/Tox/Session.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/Tox/Session.hs')
-rw-r--r--src/Network/Tox/Session.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Network/Tox/Session.hs b/src/Network/Tox/Session.hs
index 525338b2..c672087f 100644
--- a/src/Network/Tox/Session.hs
+++ b/src/Network/Tox/Session.hs
@@ -11,6 +11,7 @@ module Network.Tox.Session
11 11
12import Control.Concurrent.STM 12import Control.Concurrent.STM
13import Control.Monad 13import Control.Monad
14import Control.Exception
14import Data.Functor.Identity 15import Data.Functor.Identity
15import Data.Word 16import Data.Word
16import Network.Socket (SockAddr) 17import Network.Socket (SockAddr)
@@ -132,7 +133,15 @@ plainHandshakeH sp saddr skey handshake = do
132 <- lossless (\cp a -> return $ fmap (,a) $ checkLossless $ runIdentity $ pktData cp) 133 <- lossless (\cp a -> return $ fmap (,a) $ checkLossless $ runIdentity $ pktData cp)
133 (\seqno p _ -> do 134 (\seqno p _ -> do
134 y <- encryptPacket sk $ bookKeeping seqno p 135 y <- encryptPacket sk $ bookKeeping seqno p
135 return (lossyness (msgID p) == Lossy, y)) 136 return OutgoingInfo
137 { oIsLossy = lossyness (msgID p) == Lossy
138 , oEncoded = y
139 , oHandleException = Just $ \e -> do
140 dput XUnexpected $ unlines
141 [ "<-- " ++ show e
142 , "<-- while sending " ++ show (seqno,p) ]
143 throwIO e
144 })
136 () 145 ()
137 t 146 t
138 let _ = t :: TransportA String () (CryptoPacket Identity) (CryptoPacket Encrypted) 147 let _ = t :: TransportA String () (CryptoPacket Identity) (CryptoPacket Encrypted)