diff options
Diffstat (limited to 'src/Network/BitTorrent/DHT/Query.hs')
-rw-r--r-- | src/Network/BitTorrent/DHT/Query.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index dcb217d6..07fb80c2 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs | |||
@@ -71,7 +71,10 @@ getPeersH = nodeHandler $ \ naddr (GetPeers ih) -> do | |||
71 | 71 | ||
72 | announceH :: Address ip => NodeHandler ip | 72 | announceH :: Address ip => NodeHandler ip |
73 | announceH = nodeHandler $ \ naddr @ NodeAddr {..} (Announce {..}) -> do | 73 | announceH = nodeHandler $ \ naddr @ NodeAddr {..} (Announce {..}) -> do |
74 | checkToken naddr sessionToken | 74 | valid <- checkToken naddr sessionToken |
75 | unless valid $ do | ||
76 | throwIO $ InvalidParameter "token" | ||
77 | |||
75 | let annPort = if impliedPort then nodePort else port | 78 | let annPort = if impliedPort then nodePort else port |
76 | let peerAddr = PeerAddr Nothing nodeHost annPort | 79 | let peerAddr = PeerAddr Nothing nodeHost annPort |
77 | insertPeer topic peerAddr | 80 | insertPeer topic peerAddr |