From f75d515bc0100e5ca372d592aa2f5f4ff2fc858c Mon Sep 17 00:00:00 2001 From: joe Date: Mon, 3 Jul 2017 22:59:31 -0400 Subject: Fleshed out KRPC instances for Mainline DHT. --- src/Network/BitTorrent/DHT/Query.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Network/BitTorrent/DHT') diff --git a/src/Network/BitTorrent/DHT/Query.hs b/src/Network/BitTorrent/DHT/Query.hs index ad29adb6..77fede94 100644 --- a/src/Network/BitTorrent/DHT/Query.hs +++ b/src/Network/BitTorrent/DHT/Query.hs @@ -133,7 +133,8 @@ nodeHandler :: forall raw dht addr u t q r. IsString t, Functor dht, KRPC dht (Query dht q) (Response dht r), SerializableTo raw (Response dht r), - SerializableTo raw (Query dht q)) => + SerializableTo raw (Query dht q), + Show (QueryMethod dht)) => (NodeInfo dht addr u -> Maybe ReflectedIP -> IO ()) -> (NodeAddr addr -> IO (NodeId dht)) -> (Char -> t -> Text -> IO ()) @@ -150,6 +151,7 @@ nodeHandler insertNode myNodeIdAccordingTo logm dta method action = handler meth case fromSockAddr sockAddr of Nothing -> throwIO BadAddress Just naddr -> do + logm 'D' "nodeHandler" $ "Received query: " <> T.pack (show $ method) me <- myNodeIdAccordingTo naddr rextra <- liftIO $ makeResponseExtra dta me qry resptype let ni = NodeInfo remoteId naddr def -- cgit v1.2.3