diff options
author | joe <joe@jerkface.net> | 2017-07-03 22:59:31 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-07-03 22:59:31 -0400 |
commit | f75d515bc0100e5ca372d592aa2f5f4ff2fc858c (patch) | |
tree | 71bc354c8f6b8fed2275eb8c215d99b654c7f473 /src/Network/BitTorrent | |
parent | 78b05bf38b83b5d46468e1f938bb8c2d9dd0804f (diff) |
Fleshed out KRPC instances for Mainline DHT.
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r-- | src/Network/BitTorrent/DHT/Query.hs | 4 |
1 files changed, 3 insertions, 1 deletions
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. | |||
133 | IsString t, Functor dht, | 133 | IsString t, Functor dht, |
134 | KRPC dht (Query dht q) (Response dht r), | 134 | KRPC dht (Query dht q) (Response dht r), |
135 | SerializableTo raw (Response dht r), | 135 | SerializableTo raw (Response dht r), |
136 | SerializableTo raw (Query dht q)) => | 136 | SerializableTo raw (Query dht q), |
137 | Show (QueryMethod dht)) => | ||
137 | (NodeInfo dht addr u -> Maybe ReflectedIP -> IO ()) | 138 | (NodeInfo dht addr u -> Maybe ReflectedIP -> IO ()) |
138 | -> (NodeAddr addr -> IO (NodeId dht)) | 139 | -> (NodeAddr addr -> IO (NodeId dht)) |
139 | -> (Char -> t -> Text -> IO ()) | 140 | -> (Char -> t -> Text -> IO ()) |
@@ -150,6 +151,7 @@ nodeHandler insertNode myNodeIdAccordingTo logm dta method action = handler meth | |||
150 | case fromSockAddr sockAddr of | 151 | case fromSockAddr sockAddr of |
151 | Nothing -> throwIO BadAddress | 152 | Nothing -> throwIO BadAddress |
152 | Just naddr -> do | 153 | Just naddr -> do |
154 | logm 'D' "nodeHandler" $ "Received query: " <> T.pack (show $ method) | ||
153 | me <- myNodeIdAccordingTo naddr | 155 | me <- myNodeIdAccordingTo naddr |
154 | rextra <- liftIO $ makeResponseExtra dta me qry resptype | 156 | rextra <- liftIO $ makeResponseExtra dta me qry resptype |
155 | let ni = NodeInfo remoteId naddr def | 157 | let ni = NodeInfo remoteId naddr def |