|
|
@ -368,7 +368,7 @@ bool GetMyExternalIP(CNetAddr& ipRet)
|
|
|
|
const char* pszKeyword;
|
|
|
|
const char* pszKeyword;
|
|
|
|
|
|
|
|
|
|
|
|
for (int nLookup = 0; nLookup <= 1; nLookup++)
|
|
|
|
for (int nLookup = 0; nLookup <= 1; nLookup++)
|
|
|
|
for (int nHost = 1; nHost <= 2; nHost++)
|
|
|
|
for (int nHost = 1; nHost <= 1; nHost++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// We should be phasing out our use of sites like these. If we need
|
|
|
|
// We should be phasing out our use of sites like these. If we need
|
|
|
|
// replacements, we should ask for volunteers to put this simple
|
|
|
|
// replacements, we should ask for volunteers to put this simple
|
|
|
@ -393,25 +393,6 @@ bool GetMyExternalIP(CNetAddr& ipRet)
|
|
|
|
|
|
|
|
|
|
|
|
pszKeyword = "Address:";
|
|
|
|
pszKeyword = "Address:";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (nHost == 2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
addrConnect = CService("74.208.43.192", 80); // www.showmyip.com
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nLookup == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CService addrIP("www.showmyip.com", 80, true);
|
|
|
|
|
|
|
|
if (addrIP.IsValid())
|
|
|
|
|
|
|
|
addrConnect = addrIP;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pszGet = "GET /simple/ HTTP/1.1\r\n"
|
|
|
|
|
|
|
|
"Host: www.showmyip.com\r\n"
|
|
|
|
|
|
|
|
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"
|
|
|
|
|
|
|
|
"Connection: close\r\n"
|
|
|
|
|
|
|
|
"\r\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pszKeyword = NULL; // Returns just IP address
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet))
|
|
|
|
if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet))
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|