diff options
author | dec05eba <0xdec05eba@gmail.com> | 2018-05-16 07:25:22 +0200 |
---|---|---|
committer | dec05eba <0xdec05eba@gmail.com> | 2018-05-16 07:25:25 +0200 |
commit | ba8631c5f75df45fb07726e0aab3bb0834d6a5b6 (patch) | |
tree | fa9270cfb2c774ef9448f2d398b1fa24ac5ecf87 /src/DhtKey.cpp | |
parent | 16a9b3e33cd4e377417dcc785be7e19bf71e18b9 (diff) |
Add functions to send/receive custom messages
Diffstat (limited to 'src/DhtKey.cpp')
-rw-r--r-- | src/DhtKey.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/DhtKey.cpp b/src/DhtKey.cpp index 7bd6acf..422b715 100644 --- a/src/DhtKey.cpp +++ b/src/DhtKey.cpp @@ -8,13 +8,18 @@ namespace odhtdb firstByteOriginalValue = infoHash[0]; } - const dht::InfoHash& DhtKey::getNewDataListenerKey() + DhtKey::DhtKey(const dht::InfoHash &_infoHash) : infoHash(_infoHash) + { + firstByteOriginalValue = infoHash[0]; + } + + dht::InfoHash DhtKey::getNewDataListenerKey() { infoHash[0] = firstByteOriginalValue; return infoHash; } - const dht::InfoHash& DhtKey::getRequestOldDataKey() + dht::InfoHash DhtKey::getRequestOldDataKey() { infoHash[0] = firstByteOriginalValue + 1; return infoHash; |