diff options
author | Patric Stout <truebrain@openttd.org> | 2021-05-10 13:40:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-10 13:40:28 +0200 |
commit | 8f4a612a7c8ceb966d1cd538e9e53fd70336259d (patch) | |
tree | 81947a3db778ac4ffcbbd364796e7dedd53f27a8 /src/network/core/tcp_connect.cpp | |
parent | b7dd602dcd30bba54218e9c382d003f623110bb2 (diff) | |
download | openttd-8f4a612a7c8ceb966d1cd538e9e53fd70336259d.tar.xz |
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.
Diffstat (limited to 'src/network/core/tcp_connect.cpp')
-rw-r--r-- | src/network/core/tcp_connect.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/core/tcp_connect.cpp b/src/network/core/tcp_connect.cpp index 96c82b5af..b343ae463 100644 --- a/src/network/core/tcp_connect.cpp +++ b/src/network/core/tcp_connect.cpp @@ -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()); |