aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrik Weiskircher <pat@icore.at>2007-06-03 18:08:51 +0000
committerPatrik Weiskircher <pat@icore.at>2007-06-03 18:08:51 +0000
commitd67737bc6499545e2a372b732a578ebc28128cc2 (patch)
tree305ea0c3a6300550306c0118ac7743d7c53543ee
parent4025498488edc9e405abe21dc633b48911dcd1d9 (diff)
downloadmpd-d67737bc6499545e2a372b732a578ebc28128cc2.tar.gz
mpd-d67737bc6499545e2a372b732a578ebc28128cc2.tar.xz
mpd-d67737bc6499545e2a372b732a578ebc28128cc2.zip
allow zeroconf to be disabled.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6467 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--doc/mpd.conf.53
-rw-r--r--doc/mpdconf.example4
-rw-r--r--src/conf.c1
-rw-r--r--src/conf.h1
-rw-r--r--src/zeroconf.c9
5 files changed, 18 insertions, 0 deletions
diff --git a/doc/mpd.conf.5 b/doc/mpd.conf.5
index efe95167d..c1625c527 100644
--- a/doc/mpd.conf.5
+++ b/doc/mpd.conf.5
@@ -71,6 +71,9 @@ reports from what address a connection is opened, and when it is closed, and
"verbose" records excessive amounts of information for debugging purposes. The
default is "default".
.TP
+.B zeroconf_enabled <yes or no>
+Specifies if zeroconf should be enabled or not.
+.TP
.B zeroconf_name <name>
If Zerconf is compiled into MPD, this is the service name to publish. This
should be unique to your local network, but name collisions will be properly
diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index e935c0ac5..3a657c7f6 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
@@ -45,6 +45,10 @@ error_file "~/.mpd/mpd.error"
#
#log_level "default"
#
+# If Zeroconf support should be enabled.
+#
+#zeroconf_enabled "yes"
+#
# If Zeroconf is configured, the service name to publish. This
# should be unique on your local network, but name collisions
# will be taken care of for you.
diff --git a/src/conf.c b/src/conf.c
index 8ab59a505..1addd7e82 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -145,6 +145,7 @@ void initConf(void)
registerConfigParam(CONF_PORT, 0, 0);
registerConfigParam(CONF_LOG_LEVEL, 0, 0);
registerConfigParam(CONF_ZEROCONF_NAME, 0, 0);
+ registerConfigParam(CONF_ZEROCONF_ENABLED, 0, 0);
registerConfigParam(CONF_PASSWORD, 1, 0);
registerConfigParam(CONF_DEFAULT_PERMS, 0, 0);
registerConfigParam(CONF_AUDIO_OUTPUT, 1, 1);
diff --git a/src/conf.h b/src/conf.h
index 7059eaa90..f5ef07525 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -33,6 +33,7 @@
#define CONF_PORT "port"
#define CONF_LOG_LEVEL "log_level"
#define CONF_ZEROCONF_NAME "zeroconf_name"
+#define CONF_ZEROCONF_ENABLED "zeroconf_enabled"
#define CONF_PASSWORD "password"
#define CONF_DEFAULT_PERMS "default_permissions"
#define CONF_AUDIO_OUTPUT "audio_output"
diff --git a/src/zeroconf.c b/src/zeroconf.c
index 585c6e2bf..6dca7e10b 100644
--- a/src/zeroconf.c
+++ b/src/zeroconf.c
@@ -549,6 +549,10 @@ void initZeroconf(void)
{
const char* serviceName = SERVICE_NAME;
ConfigParam *param;
+ int enabled = getBoolConfigParam(CONF_ZEROCONF_ENABLED);
+
+ if (enabled != -1 && enabled != 1)
+ return;
param = getConfigParam(CONF_ZEROCONF_NAME);
@@ -566,6 +570,11 @@ void initZeroconf(void)
void finishZeroconf(void)
{
+ int enabled = getBoolConfigParam(CONF_ZEROCONF_ENABLED);
+
+ if (enabled != -1 && enabled != 1)
+ return;
+
#ifdef HAVE_AVAHI
DEBUG( "Avahi: Shutting down interface\n" );
deregisterIO( &zeroConfIo );