fixed Cyrils remarks

This commit is contained in:
sehraf 2020-10-04 20:41:34 +02:00
parent 26fdd79b50
commit 26d0443ff9
No known key found for this signature in database
GPG Key ID: DF09F6EAE356B2C6
3 changed files with 5 additions and 4 deletions

View File

@ -242,7 +242,7 @@ int p3BitDht::addKnownPeer( const RsPeerId &pid,
addrv4.sin_addr = ap->sin_addr; addrv4.sin_addr = ap->sin_addr;
addrv4.sin_port = ap->sin_port; addrv4.sin_port = ap->sin_port;
RsDhtPeerType p3type = static_cast<RsDhtPeerType>(0); RsDhtPeerType p3type = RsDhtPeerType::ANY;
int bdflags = 0; int bdflags = 0;
bdId id; bdId id;
bool isOwnId = false; bool isOwnId = false;
@ -469,7 +469,7 @@ DhtPeerDetails *p3BitDht::findInternalDhtPeer_locked(const bdNodeId *id, RsDhtPe
{ {
return NULL; return NULL;
} }
if (type != static_cast<RsDhtPeerType>(0)) if (type != RsDhtPeerType::ANY)
{ {
if (it->second.mPeerType != type) if (it->second.mPeerType != type)
{ {

View File

@ -166,7 +166,7 @@ int p3BitDht::setRelayMode(RsDhtRelayMode mode)
int p3BitDht::getRelayAllowance(RsDhtRelayClass classIdx, uint32_t &count, uint32_t &bandwidth) int p3BitDht::getRelayAllowance(RsDhtRelayClass classIdx, uint32_t &count, uint32_t &bandwidth)
{ {
std::cerr << "p3BitDht::getRelayAllowance(" << static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(classIdx) << "): "; std::cerr << "p3BitDht::getRelayAllowance(" << static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(classIdx) << "): ";
if ((classIdx >= static_cast<RsDhtRelayClass>(0)) && (classIdx < RsDhtRelayClass::NUM_CLASS)) if ((classIdx >= RsDhtRelayClass::ALL) && (classIdx < RsDhtRelayClass::NUM_CLASS))
{ {
count = mRelay->getRelayClassMax(static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(classIdx)); count = mRelay->getRelayClassMax(static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(classIdx));
bandwidth = mRelay->getRelayClassBandwidth(static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(classIdx)); bandwidth = mRelay->getRelayClassBandwidth(static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(classIdx));
@ -306,7 +306,7 @@ bool p3BitDht::loadList(std::list<RsItem *>& load)
int bandwidth[static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(RsDhtRelayClass::NUM_CLASS)] = {0}; int bandwidth[static_cast<typename std::underlying_type<RsDhtRelayClass>::type>(RsDhtRelayClass::NUM_CLASS)] = {0};
bool haveMode = false; bool haveMode = false;
RsDhtRelayMode mode = static_cast<RsDhtRelayMode>(0); RsDhtRelayMode mode = RsDhtRelayMode::DISABLED;
std::list<RsTlvKeyValue>::iterator it; std::list<RsTlvKeyValue>::iterator it;
for(it = config->tlvkvs.pairs.begin(); it != config->tlvkvs.pairs.end(); ++it) for(it = config->tlvkvs.pairs.begin(); it != config->tlvkvs.pairs.end(); ++it)

View File

@ -87,6 +87,7 @@ enum class RsDhtRelayClass : uint8_t
enum class RsDhtRelayMode : uint16_t enum class RsDhtRelayMode : uint16_t
{ {
DISABLED= 0x0000,
ENABLED = 0x0001, ENABLED = 0x0001,
MASK = 0x00f0, MASK = 0x00f0,