diff options
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 0a54fdf46c..daa8a8d07e 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -246,7 +246,7 @@ bool static Socks5(string strDest, int port, SOCKET& hSocket) string strSocks5("\5\1"); strSocks5 += '\000'; strSocks5 += '\003'; strSocks5 += static_cast<char>(std::min((int)strDest.size(), 255)); - strSocks5 += strDest; + strSocks5 += strDest; strSocks5 += static_cast<char>((port >> 8) & 0xFF); strSocks5 += static_cast<char>((port >> 0) & 0xFF); ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); @@ -478,7 +478,7 @@ bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout) // first connect to proxy server if (!ConnectSocketDirectly(proxy.first, hSocket, nTimeout)) return false; - + // do socks negotiation switch (proxy.second) { case 4: @@ -599,7 +599,7 @@ CNetAddr::CNetAddr(const std::string &strIp, bool fAllowLookup) *this = vIP[0]; } -int CNetAddr::GetByte(int n) const +unsigned int CNetAddr::GetByte(int n) const { return ip[15-n]; } @@ -617,8 +617,8 @@ bool CNetAddr::IsIPv6() const bool CNetAddr::IsRFC1918() const { return IsIPv4() && ( - GetByte(3) == 10 || - (GetByte(3) == 192 && GetByte(2) == 168) || + GetByte(3) == 10 || + (GetByte(3) == 192 && GetByte(2) == 168) || (GetByte(3) == 172 && (GetByte(2) >= 16 && GetByte(2) <= 31))); } @@ -702,7 +702,7 @@ bool CNetAddr::IsMulticast() const bool CNetAddr::IsValid() const { - // Clean up 3-byte shifted addresses caused by garbage in size field + // Cleanup 3-byte shifted addresses caused by garbage in size field // of addr messages from versions before 0.2.9 checksum. // Two consecutive addr messages look like this: // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26... @@ -851,13 +851,13 @@ std::vector<unsigned char> CNetAddr::GetGroup() const nClass = NET_IPV4; nStartByte = 12; } - // for 6to4 tunneled addresses, use the encapsulated IPv4 address + // for 6to4 tunnelled addresses, use the encapsulated IPv4 address else if (IsRFC3964()) { nClass = NET_IPV4; nStartByte = 2; } - // for Teredo-tunneled IPv6 addresses, use the encapsulated IPv4 address + // for Teredo-tunnelled IPv6 addresses, use the encapsulated IPv4 address else if (IsRFC4380()) { vchRet.push_back(NET_IPV4); @@ -954,7 +954,7 @@ int CNetAddr::GetReachabilityFrom(const CNetAddr *paddrPartner) const default: return REACH_DEFAULT; case NET_TEREDO: return REACH_TEREDO; case NET_IPV4: return REACH_IPV4; - case NET_IPV6: return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunneled + case NET_IPV6: return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunnelled } case NET_TOR: switch(ourNet) { @@ -1135,7 +1135,7 @@ std::vector<unsigned char> CService::GetKey() const std::string CService::ToStringPort() const { - return strprintf("%i", port); + return strprintf("%u", port); } std::string CService::ToStringIPPort() const |