From a6a026cb9e7a57ccae85d7ddebf94149c9f28aae Mon Sep 17 00:00:00 2001 From: Robert James Kaes Date: Mon, 22 Oct 2001 16:52:34 +0000 Subject: Changed the getpeer_*() functions to return the reason why the name or IP address could not be looked up. --- src/sock.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sock.c b/src/sock.c index 6e5f839..6594ecc 100644 --- a/src/sock.c +++ b/src/sock.c @@ -1,4 +1,4 @@ -/* $Id: sock.c,v 1.9 2001-10-22 15:56:11 rjkaes Exp $ +/* $Id: sock.c,v 1.10 2001-10-22 16:52:34 rjkaes Exp $ * * Sockets are created and destroyed here. When a new connection comes in from * a client, we need to copy the socket and the create a second socket to the @@ -161,7 +161,7 @@ char *getpeer_ip(int fd, char *ipaddr) assert(ipaddr != NULL); if (getpeername(fd, (struct sockaddr*)&name, &namelen) != 0) { - log_message(LOG_ERR, "Connect: 'could not get peer name'"); + log_message(LOG_ERR, "geetpeer_ip: 'could not get peer name' (\"%s\": %d)", strerror(errno), errno); *ipaddr = '\0'; } else { strlcpy(ipaddr, @@ -186,7 +186,7 @@ char *getpeer_string(int fd, char *string) assert(string != NULL); if (getpeername(fd, (struct sockaddr *)&name, &namelen) != 0) { - log_message(LOG_ERR, "Connect: 'could not get peer name'"); + log_message(LOG_ERR, "getpeer_string: 'could not get peer name' (\"%s\": %d)", strerror(errno), errno); *string = '\0'; } else { LOCK(); -- cgit v1.2.3