summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-10-03 05:41:22 -0400
committerJoe Crayne <joe@jerkface.net>2018-11-04 01:03:20 -0400
commita6d26117234ea8f447930c51d1fe1eeb08d152f4 (patch)
tree3a274b18f08c31afc7a469d120398b9ed2789f36
parenta3997c8158c36ef3b59a789e240aa2c0e6189c89 (diff)
AggregateSession: Debug print on send exception.
-rw-r--r--src/Network/Tox/AggregateSession.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Network/Tox/AggregateSession.hs b/src/Network/Tox/AggregateSession.hs
index 1dd10eef..2323673a 100644
--- a/src/Network/Tox/AggregateSession.hs
+++ b/src/Network/Tox/AggregateSession.hs
@@ -28,6 +28,7 @@ import qualified Data.IntMap.Strict as IntMap
28 ;import Data.IntMap.Strict (IntMap) 28 ;import Data.IntMap.Strict (IntMap)
29import Data.List 29import Data.List
30import Data.Time.Clock.POSIX 30import Data.Time.Clock.POSIX
31import System.IO.Error
31 32
32#ifdef THREAD_DEBUG 33#ifdef THREAD_DEBUG
33import Control.Concurrent.Lifted.Instrument 34import Control.Concurrent.Lifted.Instrument
@@ -120,7 +121,8 @@ keepAlive s q = do
120 , take 8 $ show $ key2id $ sTheirUserKey s 121 , take 8 $ show $ key2id $ sTheirUserKey s
121 , show $ sSessionID s]) 122 , show $ sSessionID s])
122 123
123 let outPrint e = dput XNetCrypto $ shows (sSessionID s,sTheirAddr s) $ " <-- " ++ e 124 let outPrint e = dput XNetCrypto $ shows (sSessionID s,sTheirAddr s) $ " <-- " ++ e
125 unexpected e = dput XUnexpected $ shows (sSessionID s,sTheirAddr s) $ " <-- " ++ e
124 126
125 doAlive = do 127 doAlive = do
126 -- outPrint $ "Beacon" 128 -- outPrint $ "Beacon"
@@ -130,6 +132,12 @@ keepAlive s q = do
130 (ns,nmin) <- sMissingInbound s 132 (ns,nmin) <- sMissingInbound s
131 -- outPrint $ "PacketRequest " ++ show (nmin,ns) 133 -- outPrint $ "PacketRequest " ++ show (nmin,ns)
132 sendMessage (sTransport s) () (RequestResend PacketRequest ns) 134 sendMessage (sTransport s) () (RequestResend PacketRequest ns)
135 `catchIOError` \e -> do
136 unexpected $ "PacketRequest " ++ take 200 (show (nmin,length ns,ns))
137 unexpected $ "PacketRequest: " ++ show e
138 -- Quit thread by scheduling a timeout event.
139 now <- getPOSIXTime
140 atomically $ modifyTVar' q $ PSQ.insert (fromEnum DoTimeout) now
133 141
134 re tm again e io = do 142 re tm again e io = do
135 io 143 io