summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Network/BitTorrent/DHT.hs4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs
index c35b5bd6..6ce4c515 100644
--- a/src/Network/BitTorrent/DHT.hs
+++ b/src/Network/BitTorrent/DHT.hs
@@ -56,22 +56,18 @@ import Network.KRPC
56 56
57pingH :: Address ip => NodeHandler ip 57pingH :: Address ip => NodeHandler ip
58pingH = nodeHandler $ \ _ Ping -> do 58pingH = nodeHandler $ \ _ Ping -> do
59 $(logDebug) "ping received, sending pong"
60 return Ping 59 return Ping
61 60
62findNodeH :: Address ip => NodeHandler ip 61findNodeH :: Address ip => NodeHandler ip
63findNodeH = nodeHandler $ \ _ (FindNode nid) -> do 62findNodeH = nodeHandler $ \ _ (FindNode nid) -> do
64 $(logDebug) "find_node received, sending closest nodes back"
65 NodeFound <$> getClosest nid 63 NodeFound <$> getClosest nid
66 64
67getPeersH :: Address ip => NodeHandler ip 65getPeersH :: Address ip => NodeHandler ip
68getPeersH = nodeHandler $ \ naddr (GetPeers ih) -> do 66getPeersH = nodeHandler $ \ naddr (GetPeers ih) -> do
69 $(logDebug) "get_peers received, trying to find peers"
70 GotPeers <$> getPeerList ih <*> grantToken naddr 67 GotPeers <$> getPeerList ih <*> grantToken naddr
71 68
72announceH :: Address ip => NodeHandler ip 69announceH :: Address ip => NodeHandler ip
73announceH = nodeHandler $ \ naddr (Announce {..}) -> do 70announceH = nodeHandler $ \ naddr (Announce {..}) -> do
74 $(logDebug) "announce received, trying to check token"
75 checkToken naddr sessionToken 71 checkToken naddr sessionToken
76 case fromAddr naddr of 72 case fromAddr naddr of
77 Nothing -> throw $ KError ProtocolError "bad address" "" 73 Nothing -> throw $ KError ProtocolError "bad address" ""