mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed Cyrils remarks
This commit is contained in:
parent
26fdd79b50
commit
26d0443ff9
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user