zeroconf: skip initialisation if there is no port

This commit is contained in:
Max Kellermann 2012-02-13 21:04:50 +01:00
parent 5540fbaec2
commit 652cfb7caf

View File

@ -21,6 +21,7 @@
#include "zeroconf.h"
#include "zeroconf-internal.h"
#include "conf.h"
#include "listen.h"
#include <glib.h>
@ -42,6 +43,12 @@ void initZeroconf(void)
if (!zeroconfEnabled)
return;
if (listen_port <= 0) {
g_warning("No global port, disabling zeroconf");
zeroconfEnabled = false;
return;
}
serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME);
#ifdef HAVE_AVAHI