A few fixes to make it compile under windows again
This commit is contained in:
@@ -41,7 +41,7 @@ static void set_nonblocking(SOCKET sock) {
|
||||
}
|
||||
|
||||
static std::string winsock_error_string(int errcode) {
|
||||
drv::ostringstream oss;
|
||||
std::ostringstream oss;
|
||||
oss << "error " << errcode;
|
||||
return oss.str();
|
||||
}
|
||||
@@ -51,7 +51,7 @@ static PADDRINFOA find_good_addr(PADDRINFOA addrinfo) {
|
||||
if (addr->ai_family == AF_INET) {
|
||||
return addr;
|
||||
}
|
||||
}std::string
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ static SOCKET open_connection(std::string_view target, std::string &err) {
|
||||
PADDRINFOA addrs = nullptr;
|
||||
PADDRINFOA goodaddr = nullptr;
|
||||
SOCKET sock = INVALID_SOCKET;
|
||||
std::string_view host, port;
|
||||
std::string host, port;
|
||||
|
||||
err.clear();
|
||||
util::split_host_port(target, host, port);
|
||||
drv::split_host_port(target, host, port);
|
||||
int status = getaddrinfo(host.data(), port.data(), nullptr, &addrs);
|
||||
while (status == WSATRY_AGAIN) {
|
||||
status = getaddrinfo(host.data(), port.data(), nullptr, &addrs);
|
||||
|
||||
Reference in New Issue
Block a user