diff options
Diffstat (limited to 'src/Network/Tox/Session.hs')
-rw-r--r-- | src/Network/Tox/Session.hs | 11 |
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 | ||
12 | import Control.Concurrent.STM | 12 | import Control.Concurrent.STM |
13 | import Control.Monad | 13 | import Control.Monad |
14 | import Control.Exception | ||
14 | import Data.Functor.Identity | 15 | import Data.Functor.Identity |
15 | import Data.Word | 16 | import Data.Word |
16 | import Network.Socket (SockAddr) | 17 | import 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) |