use ipv4 always, until backend supports ipv6

This commit is contained in:
Lion Kortlepel 2021-02-02 01:13:34 +01:00
parent 0fe4913928
commit e4fa9a23fa

View File

@ -88,15 +88,15 @@ std::string PostHTTP(const std::string& host, const std::string& target, const s
} }
return true; return true;
}; };
bool ok = try_connect_with_protocol(tcp::v6()); //bool ok = try_connect_with_protocol(tcp::v6());
//if (!ok) {
//debug("IPv6 connect failed, trying IPv4");
bool ok = try_connect_with_protocol(tcp::v4());
if (!ok) { if (!ok) {
debug("IPv6 connect failed, trying IPv4"); error("failed to resolve or connect in POST " + host + target);
ok = try_connect_with_protocol(tcp::v4()); return "-1";
if (!ok) {
error("failed to resolve or connect in POST " + host + target);
return "-1";
}
} }
//}
stream.handshake(ssl::stream_base::client); stream.handshake(ssl::stream_base::client);
http::request<http::string_body> req { http::verb::post, target, 11 /* http 1.1 */ }; http::request<http::string_body> req { http::verb::post, target, 11 /* http 1.1 */ };