zeroconf: fail if avahi service name is invalid
If the configured avahi service name is invalid, abort MPD. Don't fall back to the default service name.
This commit is contained in:
parent
e9a3c4ce32
commit
bbed35822e
|
@ -448,14 +448,10 @@ static void init_avahi(const char *serviceName)
|
|||
int error;
|
||||
g_debug("Avahi: Initializing interface");
|
||||
|
||||
if (avahi_is_valid_service_name(serviceName)) {
|
||||
avahiName = avahi_strdup(serviceName);
|
||||
} else {
|
||||
g_warning("Invalid zeroconf_name \"%s\", defaulting to "
|
||||
"\"%s\" instead.",
|
||||
serviceName, SERVICE_NAME);
|
||||
avahiName = avahi_strdup(SERVICE_NAME);
|
||||
}
|
||||
if (!avahi_is_valid_service_name(serviceName))
|
||||
g_error("Invalid zeroconf_name \"%s\"", serviceName);
|
||||
|
||||
avahiName = avahi_strdup(serviceName);
|
||||
|
||||
avahiRunning = 1;
|
||||
|
||||
|
|
Loading…
Reference in New Issue