summaryrefslogtreecommitdiff
path: root/selftest.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-20 16:07:38 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-04-20 16:07:38 -0700
commit86c87875a78efc84b123cf1661a31cb06f240f59 (patch)
tree23bacc28e28ee13faebc2805305a1652ce38dfba /selftest.cpp
parent69076f8a45a3d5d521ef69ce3df2667c1fbcbfd4 (diff)
downloadinfinitytier-86c87875a78efc84b123cf1661a31cb06f240f59.tar.gz
infinitytier-86c87875a78efc84b123cf1661a31cb06f240f59.zip
OSUtils::resolve()
Diffstat (limited to 'selftest.cpp')
-rw-r--r--selftest.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/selftest.cpp b/selftest.cpp
index 21e75924..ea90813e 100644
--- a/selftest.cpp
+++ b/selftest.cpp
@@ -758,7 +758,19 @@ static int testHttp()
std::map<std::string,std::string> requestHeaders,responseHeaders;
std::string responseBody;
- InetAddress downloadZerotierDotCom("142.4.214.72/80");
+ InetAddress downloadZerotierDotCom;
+ std::vector<InetAddress> rr(OSUtils::resolve("download.zerotier.com"));
+ if (rr.empty()) {
+ std::cout << "[http] Resolve of download.zerotier.com failed, skipping." << std::endl;
+ return 0;
+ } else {
+ for(std::vector<InetAddress>::iterator r(rr.begin());r!=rr.end();++r) {
+ std::cout << "[http] download.zerotier.com: " << r->toString() << std::endl;
+ if (r->isV4())
+ downloadZerotierDotCom = *r;
+ }
+ }
+ downloadZerotierDotCom.setPort(80);
std::cout << "[http] GET http://download.zerotier.com/dev/1k @" << downloadZerotierDotCom.toString() << " ... "; std::cout.flush();
requestHeaders["Host"] = "download.zerotier.com";