</listitem>
</varlistentry>
+ <varlistentry id="guc-bonjour" xreflabel="bonjour">
+ <term><varname>bonjour</varname> (<type>boolean</type>)</term>
+ <indexterm>
+ <primary><varname>bonjour</> configuration parameter</primary>
+ </indexterm>
+ <listitem>
+ <para>
+ Enables advertising the server's existence via
+ <productname>Bonjour</productname>. The default is off.
+ This parameter can only be set at server start.
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry id="guc-bonjour-name" xreflabel="bonjour_name">
<term><varname>bonjour_name</varname> (<type>string</type>)</term>
<indexterm>
</indexterm>
<listitem>
<para>
- Specifies the <productname>Bonjour</productname> broadcast
+ Specifies the <productname>Bonjour</productname> service
name. The computer name is used if this parameter is set to the
empty string <literal>''</> (which is the default). This parameter is
ignored if the server was not compiled with
bool Log_connections = false;
bool Db_user_namespace = false;
+bool enable_bonjour = false;
char *bonjour_name;
/* PIDs of special child processes; 0 when not running */
#ifdef USE_BONJOUR
/* Register for Bonjour only if we opened TCP socket(s) */
- if (ListenSocket[0] != -1)
+ if (enable_bonjour && ListenSocket[0] != -1)
{
DNSServiceErrorType err;
static const char *assign_custom_variable_classes(const char *newval, bool doit,
GucSource source);
static bool assign_debug_assertions(bool newval, bool doit, GucSource source);
+static bool assign_bonjour(bool newval, bool doit, GucSource source);
static bool assign_ssl(bool newval, bool doit, GucSource source);
static bool assign_stage_log_stats(bool newval, bool doit, GucSource source);
static bool assign_log_stats(bool newval, bool doit, GucSource source);
&session_auth_is_superuser,
false, NULL, NULL
},
+ {
+ {"bonjour", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
+ gettext_noop("Enables advertising the server via Bonjour."),
+ NULL
+ },
+ &enable_bonjour,
+ false, assign_bonjour, NULL
+ },
{
{"ssl", PGC_POSTMASTER, CONN_AUTH_SECURITY,
gettext_noop("Enables SSL connections."),
{
{"bonjour_name", PGC_POSTMASTER, CONN_AUTH_SETTINGS,
- gettext_noop("Sets the Bonjour broadcast service name."),
+ gettext_noop("Sets the Bonjour service name."),
NULL
},
&bonjour_name,
return true;
}
+static bool
+assign_bonjour(bool newval, bool doit, GucSource source)
+{
+#ifndef USE_BONJOUR
+ if (newval)
+ {
+ ereport(GUC_complaint_elevel(source),
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("Bonjour is not supported by this build")));
+ return false;
+ }
+#endif
+ return true;
+}
+
static bool
assign_ssl(bool newval, bool doit, GucSource source)
{