diff options
author | James Crayne <jim.crayne@gmail.com> | 2018-05-30 01:18:28 +0000 |
---|---|---|
committer | James Crayne <jim.crayne@gmail.com> | 2018-05-30 01:18:28 +0000 |
commit | b61ab59005ed50aaa594adec21853a95a2e660b3 (patch) | |
tree | 419e2f00d7713d29a21cbc487717d630dc2232c8 /src/Network/Tox/Crypto | |
parent | eb4593ae974441b8c242849305c749494b041f3c (diff) |
debug traces, handle Nothing case in ncToWire
Diffstat (limited to 'src/Network/Tox/Crypto')
-rw-r--r-- | src/Network/Tox/Crypto/Handlers.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Network/Tox/Crypto/Handlers.hs b/src/Network/Tox/Crypto/Handlers.hs index c731c82b..f4199374 100644 --- a/src/Network/Tox/Crypto/Handlers.hs +++ b/src/Network/Tox/Crypto/Handlers.hs | |||
@@ -46,6 +46,7 @@ import qualified Data.IntMap.Strict as IntMap | |||
46 | import Control.Concurrent.Supply | 46 | import Control.Concurrent.Supply |
47 | import Data.InOrOut | 47 | import Data.InOrOut |
48 | import DPut | 48 | import DPut |
49 | import Debug.Trace | ||
49 | 50 | ||
50 | -- util, todo: move to another module | 51 | -- util, todo: move to another module |
51 | maybeToEither :: Maybe b -> Either String b | 52 | maybeToEither :: Maybe b -> Either String b |
@@ -363,8 +364,10 @@ ncToWire getState seqno bufend pktno msg = do | |||
363 | GrpMsg KnownLossless _ -> Lossless | 364 | GrpMsg KnownLossless _ -> Lossless |
364 | (state,n24,msgOutMapVar) <- getState | 365 | (state,n24,msgOutMapVar) <- getState |
365 | -- msgOutMap <- readTVar msgOutMapVar | 366 | -- msgOutMap <- readTVar msgOutMapVar |
366 | result1 <- lookupInRangeMap typ64 msgOutMapVar | 367 | result1 <- trace ("lookupInRangeMap typ64=" ++ show typ64) |
368 | $ lookupInRangeMap typ64 msgOutMapVar | ||
367 | case result1 of -- msgOutMapLookup typ64 msgOutMap of | 369 | case result1 of -- msgOutMapLookup typ64 msgOutMap of |
370 | Nothing -> trace "lookupInRangeMap gave Nothing!" $ return Nothing | ||
368 | Just outid -> do | 371 | Just outid -> do |
369 | let setMessageId (OneByte _) mid = OneByte (toEnum8 mid) | 372 | let setMessageId (OneByte _) mid = OneByte (toEnum8 mid) |
370 | setMessageId (TwoByte _ x) mid = TwoByte (toEnum8 mid) x | 373 | setMessageId (TwoByte _ x) mid = TwoByte (toEnum8 mid) x |