summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/MainlineDHT.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-10-30 00:45:32 -0400
committerjoe <joe@jerkface.net>2017-10-30 00:45:32 -0400
commit4b4266424a6b1d1fb57e29f6c331462d5abb80e1 (patch)
treedbfbce692d272f08362e9989a8fffeb676701cdd /src/Network/BitTorrent/MainlineDHT.hs
parent08c02ea307d056a2825d51699e1f2e111d41a7f0 (diff)
Tox: LanDiscovery packet. Also: IsUnsolicited query/response
classification.
Diffstat (limited to 'src/Network/BitTorrent/MainlineDHT.hs')
-rw-r--r--src/Network/BitTorrent/MainlineDHT.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/MainlineDHT.hs b/src/Network/BitTorrent/MainlineDHT.hs
index a7359bda..c0413322 100644
--- a/src/Network/BitTorrent/MainlineDHT.hs
+++ b/src/Network/BitTorrent/MainlineDHT.hs
@@ -444,7 +444,7 @@ encodePacket :: Message BValue -> NodeInfo -> (ByteString, SockAddr)
444encodePacket msg ni = ( toStrict $ BE.encode msg 444encodePacket msg ni = ( toStrict $ BE.encode msg
445 , nodeAddr ni ) 445 , nodeAddr ni )
446 446
447classify :: Message BValue -> MessageClass String Method TransactionId 447classify :: Message BValue -> MessageClass String Method TransactionId NodeInfo (Message BValue)
448classify (Q { msgID = tid, qryMethod = meth }) = IsQuery meth tid 448classify (Q { msgID = tid, qryMethod = meth }) = IsQuery meth tid
449classify (R { msgID = tid }) = IsResponse tid 449classify (R { msgID = tid }) = IsResponse tid
450 450
@@ -566,7 +566,7 @@ newClient swarms addr = do
566 outgoingClient = client { clientNet = net { awaitMessage = ($ Nothing) } } 566 outgoingClient = client { clientNet = net { awaitMessage = ($ Nothing) } }
567 567
568 dispatch = DispatchMethods 568 dispatch = DispatchMethods
569 { classifyInbound = classify -- :: x -> MessageClass err meth tid 569 { classifyInbound = classify -- :: x -> MessageClass err meth tid addr x
570 , lookupHandler = handlers -- :: meth -> Maybe (MethodHandler err tid addr x) 570 , lookupHandler = handlers -- :: meth -> Maybe (MethodHandler err tid addr x)
571 , tableMethods = mapT -- :: TransactionMethods tbl tid x 571 , tableMethods = mapT -- :: TransactionMethods tbl tid x
572 } 572 }