diff options
Diffstat (limited to 'src/Network/Tox/AggregateSession.hs')
-rw-r--r-- | src/Network/Tox/AggregateSession.hs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/Network/Tox/AggregateSession.hs b/src/Network/Tox/AggregateSession.hs index 26e7153a..27258a6f 100644 --- a/src/Network/Tox/AggregateSession.hs +++ b/src/Network/Tox/AggregateSession.hs | |||
@@ -242,26 +242,7 @@ dispatchMessage c msid msg = join $ atomically $ do | |||
242 | imap <- readTVar (contactSession c) | 242 | imap <- readTVar (contactSession c) |
243 | let go = case msid of Nothing -> forM_ imap | 243 | let go = case msid of Nothing -> forM_ imap |
244 | Just sid -> forM_ (IntMap.lookup sid imap) | 244 | Just sid -> forM_ (IntMap.lookup sid imap) |
245 | return $ go $ \con -> do | 245 | return $ go $ \con -> sendLossless (transportCrypto (ncAllSessions (singleSession con))) (singleSession con) msg |
246 | outq <- atomically $ do | ||
247 | mbOutq <- readTVar (ncOutgoingQueue $ singleSession con) | ||
248 | case mbOutq of | ||
249 | HaveHandshake outq -> return outq | ||
250 | NeedHandshake -> retry | ||
251 | extra <- nqToWireIO outq | ||
252 | r <- atomically $ do | ||
253 | rTry <- tryAppendQueueOutgoing extra outq msg | ||
254 | case rTry of | ||
255 | OGFull -> retry | ||
256 | OGSuccess x -> return (OGSuccess x) | ||
257 | OGEncodeFail -> return OGEncodeFail | ||
258 | case r of | ||
259 | OGSuccess x -> case ncSockAddr (singleSession con) of | ||
260 | HaveDHTKey saddr -> sendSessionPacket (ncAllSessions $ singleSession con) saddr x | ||
261 | _ -> return () | ||
262 | OGEncodeFail -> dput XMisc ("FAILURE to Encode Outgoing: " ++ show msg) | ||
263 | _ -> return () | ||
264 | |||
265 | 246 | ||
266 | -- | Retry until: | 247 | -- | Retry until: |
267 | -- | 248 | -- |