auto_id_prefix now defaults to 'auto-'.
This commit is contained in:
parent
1d3949bce0
commit
48c2217015
@ -4,6 +4,7 @@
|
|||||||
Broker features:
|
Broker features:
|
||||||
- Improved general support for broker generated client ids. Removed libuuid
|
- Improved general support for broker generated client ids. Removed libuuid
|
||||||
dependency.
|
dependency.
|
||||||
|
- auto_id_prefix now defaults to 'auto-'.
|
||||||
|
|
||||||
Client library features:
|
Client library features:
|
||||||
- Add mosquitto_subscribe_multiple() for sending subscriptions to multiple
|
- Add mosquitto_subscribe_multiple() for sending subscriptions to multiple
|
||||||
|
@ -262,7 +262,7 @@
|
|||||||
<replaceable>true</replaceable>, this option allows you
|
<replaceable>true</replaceable>, this option allows you
|
||||||
to set a string that will be prefixed to the
|
to set a string that will be prefixed to the
|
||||||
automatically generated client ids to aid visibility in
|
automatically generated client ids to aid visibility in
|
||||||
logs. Defaults to no prefix.</para>
|
logs. Defaults to <option>auto-</option>.</para>
|
||||||
<para>Reloaded on reload signal.</para>
|
<para>Reloaded on reload signal.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -89,7 +89,8 @@
|
|||||||
|
|
||||||
# If allow_zero_length_clientid is true, this option allows you to set a prefix
|
# If allow_zero_length_clientid is true, this option allows you to set a prefix
|
||||||
# to automatically generated client ids to aid visibility in logs.
|
# to automatically generated client ids to aid visibility in logs.
|
||||||
#auto_id_prefix
|
# Defaults to 'auto-'
|
||||||
|
#auto_id_prefix auto-
|
||||||
|
|
||||||
# This option allows persistent clients (those with clean session set to false)
|
# This option allows persistent clients (those with clean session set to false)
|
||||||
# to be removed if they do not reconnect within a certain time frame.
|
# to be removed if they do not reconnect within a certain time frame.
|
||||||
|
26
src/conf.c
26
src/conf.c
@ -2066,8 +2066,10 @@ static int config__check(struct mosquitto__config *config)
|
|||||||
{
|
{
|
||||||
/* Checks that are easy to make after the config has been loaded. */
|
/* Checks that are easy to make after the config has been loaded. */
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
#ifdef WITH_BRIDGE
|
#ifdef WITH_BRIDGE
|
||||||
int i, j;
|
int j;
|
||||||
struct mosquitto__bridge *bridge1, *bridge2;
|
struct mosquitto__bridge *bridge1, *bridge2;
|
||||||
char hostname[256];
|
char hostname[256];
|
||||||
int len;
|
int len;
|
||||||
@ -2115,6 +2117,28 @@ static int config__check(struct mosquitto__config *config)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Default to auto_id_prefix = 'auto-' if none set. */
|
||||||
|
if(config->per_listener_settings){
|
||||||
|
for(i=0; i<config->listener_count; i++){
|
||||||
|
if(!config->listeners[i].security_options.auto_id_prefix){
|
||||||
|
config->listeners[i].security_options.auto_id_prefix = mosquitto__strdup("auto-");
|
||||||
|
if(!config->listeners[i].security_options.auto_id_prefix){
|
||||||
|
return MOSQ_ERR_NOMEM;
|
||||||
|
}
|
||||||
|
config->listeners[i].security_options.auto_id_prefix_len = strlen("auto-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(!config->security_options.auto_id_prefix){
|
||||||
|
config->security_options.auto_id_prefix = mosquitto__strdup("auto-");
|
||||||
|
if(!config->security_options.auto_id_prefix){
|
||||||
|
return MOSQ_ERR_NOMEM;
|
||||||
|
}
|
||||||
|
config->security_options.auto_id_prefix_len = strlen("auto-");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user