From 752bf24b7475d89e97a450bab353f3a1892a1ce0 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Mon, 27 Aug 2007 21:10:44 +0000 Subject: interface: print whole debug message at once Using SECURE once without a \n, and again with one, results in a timestamp mid-line. Let's not do that. git-svn-id: https://svn.musicpd.org/mpd/trunk@6827 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/interface.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/interface.c b/src/interface.c index 22660432f..b7704ec9a 100644 --- a/src/interface.c +++ b/src/interface.c @@ -254,6 +254,7 @@ static void closeInterface(Interface * interface) void openAInterface(int fd, struct sockaddr *addr) { + char *hostname; int i; for (i = 0; i < interface_max_connections @@ -263,16 +264,15 @@ void openAInterface(int fd, struct sockaddr *addr) ERROR("Max Connections Reached!\n"); xclose(fd); } else { - SECURE("interface %i: opened from ", i); switch (addr->sa_family) { case AF_INET: { char *host = inet_ntoa(((struct sockaddr_in *) addr)->sin_addr); if (host) { - SECURE("%s\n", host); + hostname = host; } else { - SECURE("error getting ipv4 address\n"); + hostname = "error getting ipv4 address"; } } break; @@ -285,19 +285,20 @@ void openAInterface(int fd, struct sockaddr *addr) &(((struct sockaddr_in6 *)addr)-> sin6_addr), host, INET6_ADDRSTRLEN)) { - SECURE("%s\n", host); + hostname = host; } else { - SECURE("error getting ipv6 address\n"); + hostname = "error getting ipv6 address"; } } break; #endif case AF_UNIX: - SECURE("local connection\n"); + hostname = "local connection"; break; default: - SECURE("unknown\n"); + hostname = "unknown"; } + SECURE("interface %i: opened from %s\n", i, hostname); openInterface(&(interfaces[i]), fd); } } -- cgit v1.2.3