aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/odhtdb/Database.hpp3
-rw-r--r--include/odhtdb/DatabaseStorage.hpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp
index a2914ac..6874fe0 100644
--- a/include/odhtdb/Database.hpp
+++ b/include/odhtdb/Database.hpp
@@ -201,8 +201,11 @@ namespace odhtdb
// Return true in @callbackFunc if you want to continue listening for responses, otherwise return false
void sendCustomMessage(const dht::InfoHash &key, std::vector<u8> &&data, SendCustomMessageCallbackFunc callbackFunc);
+ int clearCache();
+
static dht::InfoHash getInfoHash(const void *data, usize size);
private:
+ void sendOldDataToPeer(const DatabaseNode nodeToSeed, const std::shared_ptr<dht::InfoHash> requestResponseInfoHash, const std::shared_ptr<dht::Value> value, usize valueOffset);
void deserializeCreateRequest(const std::shared_ptr<dht::Value> &value, const Hash &hash, const std::shared_ptr<OwnedByteArray> encryptionKey);
void deserializeAddRequest(const std::shared_ptr<dht::Value> &value, const Hash &requestDataHash, const std::shared_ptr<Hash> &nodeHash, const std::shared_ptr<OwnedByteArray> encryptionKey);
bool listenCreateData(std::shared_ptr<dht::Value> value, const Hash &hash, const std::shared_ptr<OwnedByteArray> encryptionKey);
diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp
index 9f93994..757fbfd 100644
--- a/include/odhtdb/DatabaseStorage.hpp
+++ b/include/odhtdb/DatabaseStorage.hpp
@@ -148,6 +148,9 @@ namespace odhtdb
// Update storage state (remove quarantine objects if they are too old, etc)
void update();
+
+ // Return number of bytes cleared
+ int clearCache();
private:
void init(const boost::filesystem::path &storagePath);
void cleanup();