From f1b3e41e632fa0bf661df5b4e5c54a979105d4f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Sat, 14 May 2016 14:39:49 -0400
Subject: [PATCH] securedht: override all versions of Dht::get

---
 include/opendht/dht.h       | 6 +++---
 include/opendht/securedht.h | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/opendht/dht.h b/include/opendht/dht.h
index a49892be..5db34f39 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 b5dd7774..d997495c 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;
 
-- 
GitLab