Change: reworded many of the network errors during connect/listen (#9230)

Also changed some levels to 0, as a failing listen() is something
we should tell the user about. Hiding this information is a bit
evil.
This commit is contained in:
Patric Stout
2021-05-10 13:40:28 +02:00
committed by GitHub
parent b7dd602dcd
commit 8f4a612a7c
2 changed files with 19 additions and 12 deletions

View File

@@ -64,8 +64,12 @@ void TCPConnecter::Connect(addrinfo *address)
return;
}
if (!SetNoDelay(sock)) DEBUG(net, 1, "Setting TCP_NODELAY failed");
if (!SetNonBlocking(sock)) DEBUG(net, 0, "Setting non-blocking mode failed");
if (!SetNoDelay(sock)) {
DEBUG(net, 1, "Setting TCP_NODELAY failed: %s", NetworkError::GetLast().AsString());
}
if (!SetNonBlocking(sock)) {
DEBUG(net, 0, "Setting non-blocking mode failed: %s", NetworkError::GetLast().AsString());
}
NetworkAddress network_address = NetworkAddress(address->ai_addr, (int)address->ai_addrlen);
DEBUG(net, 4, "Attempting to connect to %s", network_address.GetAddressAsString().c_str());