diff options
Diffstat (limited to 'src/Network/Tox/AggregateSession.hs')
-rw-r--r-- | src/Network/Tox/AggregateSession.hs | 10 |
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) |
29 | import Data.List | 29 | import Data.List |
30 | import Data.Time.Clock.POSIX | 30 | import Data.Time.Clock.POSIX |
31 | import System.IO.Error | ||
31 | 32 | ||
32 | #ifdef THREAD_DEBUG | 33 | #ifdef THREAD_DEBUG |
33 | import Control.Concurrent.Lifted.Instrument | 34 | import 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 |