diff options
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp index 5418c3de40..4ee1895a80 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -129,7 +129,7 @@ CAddress GetLocalAddress(const CNetAddr *paddrPeer) bool RecvLine(SOCKET hSocket, string& strLine) { strLine = ""; - loop + while (true) { char c; int nBytes = recv(hSocket, &c, 1, 0); @@ -301,7 +301,7 @@ bool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const cha { if (strLine.empty()) // HTTP response is separated from headers by blank line { - loop + while (true) { if (!RecvLine(hSocket, strLine)) { @@ -741,7 +741,7 @@ static list<CNode*> vNodesDisconnected; void ThreadSocketHandler() { unsigned int nPrevNodeCount = 0; - loop + while (true) { // // Disconnect nodes @@ -1105,7 +1105,7 @@ void ThreadMapPort() string strDesc = "Bitcoin " + FormatFullVersion(); try { - loop { + while (true) { #ifndef UPNPDISCOVER_SUCCESS /* miniupnpc 1.5 */ r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, @@ -1268,7 +1268,7 @@ void ThreadOpenConnections() // Initiate network connections int64 nStart = GetTime(); - loop + while (true) { ProcessOneShot(); @@ -1309,7 +1309,7 @@ void ThreadOpenConnections() int64 nANow = GetAdjustedTime(); int nTries = 0; - loop + while (true) { // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections) CAddress addr = addrman.Select(10 + min(nOutbound,8)*10); @@ -1598,8 +1598,12 @@ bool BindListenPort(const CService &addrBind, string& strError) // and enable it by default or not. Try to enable it, if possible. if (addrBind.IsIPv6()) { #ifdef IPV6_V6ONLY +#ifdef WIN32 + setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&nOne, sizeof(int)); +#else setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int)); #endif +#endif #ifdef WIN32 int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */; int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */; |