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
This commit is contained in:
parent
8d89add8e7
commit
752bf24b74
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user