summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-08 11:56:33 +0100
committerMichael Adam <obnox@samba.org>2013-11-09 13:34:33 +0100
commita7898a2c989b615142a80634fc37d433273698b9 (patch)
treeed04ec1da53f5c8058e9315ebc6af035807faf68 /src
parent947e255d191d18087059f385193e791ba651bc92 (diff)
downloadtinyproxy-a7898a2c989b615142a80634fc37d433273698b9.tar.gz
tinyproxy-a7898a2c989b615142a80634fc37d433273698b9.zip
sock: log each result of getaddrinfo() in listen_sock()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/sock.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sock.c b/src/sock.c
index fbbd9aa..23ebd13 100644
--- a/src/sock.c
+++ b/src/sock.c
@@ -193,6 +193,20 @@ int listen_sock (const char *addr, uint16_t port, vector_t listen_fds)
for (rp = result; rp != NULL; rp = rp->ai_next) {
int listenfd;
int lret;
+ char numerichost[NI_MAXHOST];
+ int flags = NI_NUMERICHOST;
+
+ ret = getnameinfo(rp->ai_addr, rp->ai_addrlen,
+ numerichost, NI_MAXHOST, NULL, 0, flags);
+ if (ret != 0) {
+ log_message(LOG_ERR, "error calling getnameinfo: %s",
+ gai_strerror(errno));
+ continue;
+ }
+
+ log_message(LOG_INFO, "trying host[%s], family[%d], "
+ "socktype[%d], proto[%d]", numerichost,
+ rp->ai_family, rp->ai_socktype, rp->ai_protocol);
listenfd = socket (rp->ai_family, rp->ai_socktype,
rp->ai_protocol);