aboutsummaryrefslogtreecommitdiffstats
path: root/src/interface.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-08-27 21:10:44 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-08-27 21:10:44 +0000
commit752bf24b7475d89e97a450bab353f3a1892a1ce0 (patch)
tree771fcd66d085fa814bb5a33f8a00909b5f0fb034 /src/interface.c
parent8d89add8e78d32b14df151e4b2825545b9be3e45 (diff)
downloadmpd-752bf24b7475d89e97a450bab353f3a1892a1ce0.tar.gz
mpd-752bf24b7475d89e97a450bab353f3a1892a1ce0.tar.xz
mpd-752bf24b7475d89e97a450bab353f3a1892a1ce0.zip
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
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c15
1 files 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);
}
}