From 83b21cc152186f12f8bc76b7aec3107e220d5219 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 17 Dec 2012 14:02:59 +0100 Subject: [PATCH] core: Hide /var/run/sdp support behind command line option By default /var/run/sdp support has been disabled from now on. It is not the preferred way of handling SDP records. For testing and development purposes it can be switched back on via --compat command line option. --- src/main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 59a0ad970..81f348f87 100644 --- a/src/main.c +++ b/src/main.c @@ -323,6 +323,7 @@ static guint setup_signalfd(void) static gchar *option_debug = NULL; static gchar *option_plugin = NULL; static gchar *option_noplugin = NULL; +static gboolean option_compat = FALSE; static gboolean option_detach = TRUE; static gboolean option_version = FALSE; @@ -408,6 +409,8 @@ static GOptionEntry options[] = { "Specify plugins to load", "NAME,..," }, { "noplugin", 'P', 0, G_OPTION_ARG_STRING, &option_noplugin, "Specify plugins not to load", "NAME,..." }, + { "compat", 'C', 0, G_OPTION_ARG_NONE, &option_compat, + "Provide deprecated command line interfaces" }, { "nodetach", 'n', G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &option_detach, "Run with logging in foreground" }, @@ -420,7 +423,8 @@ int main(int argc, char *argv[]) { GOptionContext *context; GError *err = NULL; - uint16_t mtu = 0; + uint16_t sdp_mtu = 0; + uint32_t sdp_flags = 0; GKeyFile *config; guint signal, watchdog; const char *watchdog_usec; @@ -471,7 +475,10 @@ int main(int argc, char *argv[]) exit(1); } - start_sdp_server(mtu, SDP_SERVER_COMPAT); + if (option_compat == TRUE) + sdp_flags |= SDP_SERVER_COMPAT; + + start_sdp_server(sdp_mtu, sdp_flags); /* Loading plugins has to be done after D-Bus has been setup since * the plugins might wanna expose some paths on the bus. However the -- 2.47.3