diff options
author | Pierre Ossman <ossman@cendio.se> | 2015-07-30 12:25:52 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2015-07-30 12:25:52 +0200 |
commit | b7e5574a3a3c5d2a8f9bf09de376e88be4364bcc (patch) | |
tree | c11e6b83eebd7c578b4691666ce7bb3582b755ea | |
parent | 5a126667a3e375df227be69689a150fec0d75a28 (diff) | |
download | tigervnc-b7e5574a3a3c5d2a8f9bf09de376e88be4364bcc.tar.gz tigervnc-b7e5574a3a3c5d2a8f9bf09de376e88be4364bcc.zip |
Log which addresses connection attempts are made against
-rw-r--r-- | common/network/TcpSocket.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/network/TcpSocket.cxx b/common/network/TcpSocket.cxx index 684ff8b3..f51873c1 100644 --- a/common/network/TcpSocket.cxx +++ b/common/network/TcpSocket.cxx @@ -169,6 +169,7 @@ TcpSocket::TcpSocket(const char *host, int port) int family; vnc_sockaddr_t sa; socklen_t salen; + char ntop[NI_MAXHOST]; family = current->ai_family; @@ -193,6 +194,9 @@ TcpSocket::TcpSocket(const char *host, int port) else sa.u.sin6.sin6_port = htons(port); + getnameinfo(&sa.u.sa, salen, ntop, sizeof(ntop), NULL, 0, NI_NUMERICHOST); + vlog.debug("Connecting to %s [%s] port %d", host, ntop, port); + sock = socket (family, SOCK_STREAM, 0); if (sock == -1) { err = errorNumber; @@ -207,6 +211,8 @@ TcpSocket::TcpSocket(const char *host, int port) if (err == EINTR) continue; #endif + vlog.debug("Failed to connect to address %s port %d: %d", + ntop, port, err); closesocket(sock); sock = -1; break; |