diff --git a/include/opendht/dht.h b/include/opendht/dht.h index a49892beff5ad42c610a70506926b8f7e4076119..5db34f396af17796bb4144a6b33368c02cccf21a 100644 --- a/include/opendht/dht.h +++ b/include/opendht/dht.h @@ -141,10 +141,10 @@ public: virtual void get(const InfoHash& key, GetCallback cb, DoneCallbackSimple donecb={}, Value::Filter&& f={}) { get(key, cb, bindDoneCb(donecb), std::forward<Value::Filter>(f)); } - void get(const InfoHash& key, GetCallbackSimple cb, DoneCallback donecb={}, Value::Filter&& f={}) { + virtual void get(const InfoHash& key, GetCallbackSimple cb, DoneCallback donecb={}, Value::Filter&& f={}) { get(key, bindGetCb(cb), donecb, std::forward<Value::Filter>(f)); } - void get(const InfoHash& key, GetCallbackSimple cb, DoneCallbackSimple donecb, Value::Filter&& f={}) { + virtual void get(const InfoHash& key, GetCallbackSimple cb, DoneCallbackSimple donecb, Value::Filter&& f={}) { get(key, bindGetCb(cb), bindDoneCb(donecb), std::forward<Value::Filter>(f)); } @@ -208,7 +208,7 @@ public: return listen(key, bindGetCb(cb), std::forward<Value::Filter>(f)); } - bool cancelListen(const InfoHash&, size_t token); + virtual bool cancelListen(const InfoHash&, size_t token); /** * Inform the DHT of lower-layer connectivity changes. diff --git a/include/opendht/securedht.h b/include/opendht/securedht.h index b5dd7774de5db6393c59b453952b94f4b3f1152f..d997495cc2e2ad6ab06e4390a2818a6fc1a5d87c 100644 --- a/include/opendht/securedht.h +++ b/include/opendht/securedht.h @@ -89,6 +89,12 @@ public: virtual void get(const InfoHash& id, GetCallback cb, DoneCallbackSimple donecb={}, Value::Filter&& f = {}) override { get(id, cb, bindDoneCb(donecb), std::forward<Value::Filter>(f)); } + virtual void get(const InfoHash& key, GetCallbackSimple cb, DoneCallback donecb={}, Value::Filter&& f={}) override { + get(key, bindGetCb(cb), donecb, std::forward<Value::Filter>(f)); + } + virtual void get(const InfoHash& key, GetCallbackSimple cb, DoneCallbackSimple donecb, Value::Filter&& f={}) override { + get(key, bindGetCb(cb), bindDoneCb(donecb), std::forward<Value::Filter>(f)); + } virtual size_t listen(const InfoHash& id, GetCallback cb, Value::Filter&& = {}) override;