summaryrefslogtreecommitdiff
path: root/dht/src/Network/BitTorrent/MainlineDHT.hs
diff options
context:
space:
mode:
Diffstat (limited to 'dht/src/Network/BitTorrent/MainlineDHT.hs')
-rw-r--r--dht/src/Network/BitTorrent/MainlineDHT.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/dht/src/Network/BitTorrent/MainlineDHT.hs b/dht/src/Network/BitTorrent/MainlineDHT.hs
index ed97ee31..0269268f 100644
--- a/dht/src/Network/BitTorrent/MainlineDHT.hs
+++ b/dht/src/Network/BitTorrent/MainlineDHT.hs
@@ -428,8 +428,9 @@ showPacket f addr flow bs = L8.unpack $ L8.unlines es
428addVerbosity :: Transport err SockAddr ByteString -> Transport err SockAddr ByteString 428addVerbosity :: Transport err SockAddr ByteString -> Transport err SockAddr ByteString
429addVerbosity tr = 429addVerbosity tr =
430 tr { awaitMessage = \kont -> awaitMessage tr $ \m -> do 430 tr { awaitMessage = \kont -> awaitMessage tr $ \m -> do
431 forM_ m $ mapM_ $ \(msg,addr) -> do 431 case m of
432 dput XBitTorrent (showPacket id addr " --> " msg) 432 Arrival addr msg -> dput XBitTorrent (showPacket id addr " --> " msg)
433 _ -> return ()
433 kont m 434 kont m
434 , sendMessage = \addr msg -> do 435 , sendMessage = \addr msg -> do
435 dput XBitTorrent (showPacket id addr " <-- " msg) 436 dput XBitTorrent (showPacket id addr " <-- " msg)
@@ -598,7 +599,7 @@ newClient swarms addr = do
598 -- recursive since 'updateRouting' does not invoke 'awaitMessage' which 599 -- recursive since 'updateRouting' does not invoke 'awaitMessage' which
599 -- which was modified by 'onInbound'. However, I'm going to avoid the 600 -- which was modified by 'onInbound'. However, I'm going to avoid the
600 -- mutual reference just to be safe. 601 -- mutual reference just to be safe.
601 outgoingClient = client { clientNet = net { awaitMessage = ($ Nothing) } } 602 outgoingClient = client { clientNet = net { awaitMessage = pure . ($ Terminated) } }
602 603
603 dispatch = DispatchMethods 604 dispatch = DispatchMethods
604 { classifyInbound = classify -- :: x -> MessageClass err meth tid addr x 605 { classifyInbound = classify -- :: x -> MessageClass err meth tid addr x