Browse Source

fixed typos

pull/1901/head
orignal 2 years ago
parent
commit
3154eda6a6
  1. 14
      libi2pd/RouterInfo.cpp
  2. 8
      libi2pd/RouterInfo.h

14
libi2pd/RouterInfo.cpp

@ -535,13 +535,13 @@ namespace data
case CAPS_FLAG_UNREACHABLE: case CAPS_FLAG_UNREACHABLE:
m_Caps |= Caps::eUnreachable; m_Caps |= Caps::eUnreachable;
break; break;
case CAPS_FLAG_MEDIUM_COGNESTION: case CAPS_FLAG_MEDIUM_CONGESTION:
m_Congestion = eMediumCongestion; m_Congestion = eMediumCongestion;
break; break;
case CAPS_FLAG_HIGH_COGNESTION: case CAPS_FLAG_HIGH_CONGESTION:
m_Congestion = eHighCongestion; m_Congestion = eHighCongestion;
break; break;
case CAPS_FLAG_REJECT_ALL_COGNESTION: case CAPS_FLAG_REJECT_ALL_CONGESTION:
m_Congestion = eRejectAll; m_Congestion = eRejectAll;
break; break;
default: ; default: ;
@ -1071,7 +1071,7 @@ namespace data
if (m_Congestion == eLowCongestion || m_Congestion == eMediumCongestion) return false; if (m_Congestion == eLowCongestion || m_Congestion == eMediumCongestion) return false;
if (m_Congestion == eRejectAll) return true; if (m_Congestion == eRejectAll) return true;
if (m_Congestion == eHighCongestion) if (m_Congestion == eHighCongestion)
return (i2p::util::GetMillisecondsSinceEpoch () < m_Timestamp + HIGH_COGNESION_INTERVAL*1000LL) ? true : false; return (i2p::util::GetMillisecondsSinceEpoch () < m_Timestamp + HIGH_CONGESION_INTERVAL*1000LL) ? true : false;
return false; return false;
} }
@ -1129,13 +1129,13 @@ namespace data
switch (GetCongestion ()) switch (GetCongestion ())
{ {
case eMediumCongestion: case eMediumCongestion:
caps += CAPS_FLAG_MEDIUM_COGNESTION; caps += CAPS_FLAG_MEDIUM_CONGESTION;
break; break;
case eHighCongestion: case eHighCongestion:
caps += CAPS_FLAG_HIGH_COGNESTION; caps += CAPS_FLAG_HIGH_CONGESTION;
break; break;
case eRejectAll: case eRejectAll:
caps += CAPS_FLAG_REJECT_ALL_COGNESTION; caps += CAPS_FLAG_REJECT_ALL_CONGESTION;
break; break;
default: ; default: ;
}; };

8
libi2pd/RouterInfo.h

@ -45,9 +45,9 @@ namespace data
const char CAPS_FLAG_EXTRA_BANDWIDTH1 = 'P'; /* 256-2000 KBps */ const char CAPS_FLAG_EXTRA_BANDWIDTH1 = 'P'; /* 256-2000 KBps */
const char CAPS_FLAG_EXTRA_BANDWIDTH2 = 'X'; /* > 2000 KBps */ const char CAPS_FLAG_EXTRA_BANDWIDTH2 = 'X'; /* > 2000 KBps */
// congesion flags // congesion flags
const char CAPS_FLAG_MEDIUM_COGNESTION = 'D'; const char CAPS_FLAG_MEDIUM_CONGESTION = 'D';
const char CAPS_FLAG_HIGH_COGNESTION = 'E'; const char CAPS_FLAG_HIGH_CONGESTION = 'E';
const char CAPS_FLAG_REJECT_ALL_COGNESTION = 'G'; const char CAPS_FLAG_REJECT_ALL_CONGESTION = 'G';
const char CAPS_FLAG_V4 = '4'; const char CAPS_FLAG_V4 = '4';
const char CAPS_FLAG_V6 = '6'; const char CAPS_FLAG_V6 = '6';
@ -60,7 +60,7 @@ namespace data
const uint8_t COST_SSU2_NON_PUBLISHED = 15; const uint8_t COST_SSU2_NON_PUBLISHED = 15;
const size_t MAX_RI_BUFFER_SIZE = 3072; // if RouterInfo exceeds 3K we consider it as malformed, might extend later const size_t MAX_RI_BUFFER_SIZE = 3072; // if RouterInfo exceeds 3K we consider it as malformed, might extend later
const int HIGH_COGNESION_INTERVAL = 15*60; // in seconds, 15 minutes const int HIGH_CONGESION_INTERVAL = 15*60; // in seconds, 15 minutes
class RouterInfo: public RoutingDestination class RouterInfo: public RoutingDestination
{ {

Loading…
Cancel
Save