diff options
author | joe <joe@jerkface.net> | 2017-07-03 18:46:14 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-07-03 18:46:14 -0400 |
commit | 81bcffd68c9997b8e4b5f8c2d4cb1e4db4c62153 (patch) | |
tree | 123f6236b1f4d4f70f2d0fc260e5d0b28159741c /src/Network/KRPC/Method.hs | |
parent | be15a1ceba3b87f845d3b56915207457a94394ee (diff) |
Moved node-id out of Query/Response. It can be either in the
envelope (Tox) or in the query/response payload (Mainline).
Diffstat (limited to 'src/Network/KRPC/Method.hs')
-rw-r--r-- | src/Network/KRPC/Method.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Network/KRPC/Method.hs b/src/Network/KRPC/Method.hs index a31380cc..4d2be86d 100644 --- a/src/Network/KRPC/Method.hs +++ b/src/Network/KRPC/Method.hs | |||
@@ -88,7 +88,7 @@ showsMethod (Method name) = | |||
88 | -- method = \"ping\" | 88 | -- method = \"ping\" |
89 | -- @ | 89 | -- @ |
90 | -- | 90 | -- |
91 | class ( Typeable req, Typeable resp) | 91 | class ( Typeable req, Typeable resp, Envelope dht) |
92 | => KRPC dht req resp | req -> resp, resp -> req where | 92 | => KRPC dht req resp | req -> resp, resp -> req where |
93 | 93 | ||
94 | -- | Method name. Default implementation uses lowercased @req@ | 94 | -- | Method name. Default implementation uses lowercased @req@ |
@@ -106,5 +106,8 @@ class ( Typeable req, Typeable resp) | |||
106 | validateExchange :: dht req -> dht resp -> Bool | 106 | validateExchange :: dht req -> dht resp -> Bool |
107 | validateExchange _ _ = True | 107 | validateExchange _ _ = True |
108 | 108 | ||
109 | makeQueryExtra :: DHTData dht ip -> Proxy req -> Proxy resp -> IO (QueryExtra dht) | 109 | makeQueryExtra :: DHTData dht ip -> NodeId dht -> Proxy req -> Proxy resp -> IO (QueryExtra dht) |
110 | makeResponseExtra :: DHTData dht ip -> req -> Proxy resp -> IO (ResponseExtra dht) | 110 | makeResponseExtra :: DHTData dht ip -> NodeId dht -> req -> Proxy resp -> IO (ResponseExtra dht) |
111 | |||
112 | messageSender :: dht req -> Proxy resp -> NodeId dht | ||
113 | messageResponder :: Proxy req -> dht resp -> NodeId dht | ||