diff options
-rw-r--r-- | src/Network/BitTorrent/DHT.hs | 4 |
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 | ||
57 | pingH :: Address ip => NodeHandler ip | 57 | pingH :: Address ip => NodeHandler ip |
58 | pingH = nodeHandler $ \ _ Ping -> do | 58 | pingH = nodeHandler $ \ _ Ping -> do |
59 | $(logDebug) "ping received, sending pong" | ||
60 | return Ping | 59 | return Ping |
61 | 60 | ||
62 | findNodeH :: Address ip => NodeHandler ip | 61 | findNodeH :: Address ip => NodeHandler ip |
63 | findNodeH = nodeHandler $ \ _ (FindNode nid) -> do | 62 | findNodeH = nodeHandler $ \ _ (FindNode nid) -> do |
64 | $(logDebug) "find_node received, sending closest nodes back" | ||
65 | NodeFound <$> getClosest nid | 63 | NodeFound <$> getClosest nid |
66 | 64 | ||
67 | getPeersH :: Address ip => NodeHandler ip | 65 | getPeersH :: Address ip => NodeHandler ip |
68 | getPeersH = nodeHandler $ \ naddr (GetPeers ih) -> do | 66 | getPeersH = 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 | ||
72 | announceH :: Address ip => NodeHandler ip | 69 | announceH :: Address ip => NodeHandler ip |
73 | announceH = nodeHandler $ \ naddr (Announce {..}) -> do | 70 | announceH = 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" "" |