mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
network: use full 32-bits of transaction IDs
We used to use the first 16 bits for the message type.
This commit is contained in:
1 parent
4501217c21
commit
476fbb1160
12 files changed
+151
-180
No files matched your search
@@ -19,7 +19,6 @@
|
||||
#include "utils.h"
|
||||
#include "sockaddr.h"
|
||||
#include "default_types.h"
|
||||
#include "net.h"
|
||||
|
||||
/* An IPv4 equivalent to IN6_IS_ADDR_UNSPECIFIED */
|
||||
#ifndef IN_IS_ADDR_UNSPECIFIED
|
||||
@@ -161,18 +160,4 @@ findMapValue(msgpack::object& map, const std::string& key) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
namespace net {
|
||||
|
||||
TransId
|
||||
unpackTid(msgpack::object& o) {
|
||||
switch (o.type) {
|
||||
case msgpack::type::POSITIVE_INTEGER:
|
||||
return o.as<uint32_t>();
|
||||
default:
|
||||
return o.as<std::array<char, 4>>();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user