From 836d4534d657361a67861630e1aa9888dbe95030 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Sat, 16 Nov 2013 03:03:43 +0100 Subject: sock: add debug messages to opensock() log entering opensock and successful return of getaddrinfo. This allows to detect dns timeouts from looking at the logs. Signed-off-by: Michael Adam --- src/sock.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sock.c b/src/sock.c index e7bd450..eef606a 100644 --- a/src/sock.c +++ b/src/sock.c @@ -84,6 +84,9 @@ int opensock (const char *host, int port, const char *bind_to) assert (host != NULL); assert (port > 0); + log_message(LOG_INFO, + "opensock: opening connection to %s:%d", host, port); + memset (&hints, 0, sizeof (struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; @@ -97,6 +100,9 @@ int opensock (const char *host, int port, const char *bind_to) return -1; } + log_message(LOG_INFO, + "opensock: getaddrinfo returned for %s:%d", host, port); + ressave = res; do { sockfd = -- cgit v1.2.3