Man page entry for bridge_tcp_keepalive.

pull/2128/head
Roger A. Light 5 years ago
parent 992d9ec9e2
commit 5d6e6aa406

@ -1578,6 +1578,23 @@ openssl dhparam -out dhparam.pem 2048</programlisting>
<replaceable>mqttv311</replaceable>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>bridge_tcp_keepalive</option> <replaceable>idle</replaceable> <replaceable>interval</replaceable> <replaceable>counter</replaceable></term>
<listitem>
<para>
Set TCP keepalive parameters for this bridge connection.
Use this option to allow you to set a long MQTT
keepalive value, whilst still being able to detect the
connection dropping in a reasonable time.
</para>
<para>
This may be useful when bridging to services that bill
for PINGREQ messages.
</para>
<para>Disabled by default.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>cleansession</option> [ true | false ]</term>
<listitem>

@ -695,7 +695,7 @@
# Set TCP keepalive parameters for this bridge connection.
# Disabled by default.
#tcp_keepalive <idle> <interval> <counter>
#bridge_tcp_keepalive <idle> <interval> <counter>
# Set the clientid to use on the local broker. If not defined, this defaults to
# 'local.<clientid>'. If you are bridging a broker to itself, it is important

@ -1168,6 +1168,36 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct
}
#else
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif
}else if(!strcmp(token, "bridge_tcp_keepalive")){
#ifdef WITH_BRIDGE
if(!cur_bridge){
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
return MOSQ_ERR_INVAL;
}
if(conf__parse_int(&token, "bridge_tcp_keepalive_idle", &tmp_int, &saveptr)) return MOSQ_ERR_INVAL;
if(tmp_int <= 0) {
log__printf(NULL, MOSQ_LOG_ERR, "Error: invalid TCP keepalive idle value.");
return MOSQ_ERR_INVAL;
}
cur_bridge->tcp_keepalive_idle = (unsigned int)tmp_int;
if(conf__parse_int(&token, "bridge_tcp_keepalive_interval", &tmp_int, &saveptr)) return MOSQ_ERR_INVAL;
if(tmp_int <= 0) {
log__printf(NULL, MOSQ_LOG_ERR, "Error: invalid TCP keepalive interval value.");
return MOSQ_ERR_INVAL;
}
cur_bridge->tcp_keepalive_interval = (unsigned int)tmp_int;
if(conf__parse_int(&token, "bridge_tcp_keepalive_counter", &tmp_int, &saveptr)) return MOSQ_ERR_INVAL;
if(tmp_int <= 0) {
log__printf(NULL, MOSQ_LOG_ERR, "Error: invalid TCP keepalive counter value.");
return MOSQ_ERR_INVAL;
}
cur_bridge->tcp_keepalive_counter = (unsigned int)tmp_int;
#else
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif
}else if(!strcmp(token, "bridge_tls_version")){
#if defined(WITH_BRIDGE) && defined(WITH_TLS)
@ -1402,36 +1432,6 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, struct
cur_bridge->keepalive = (uint16_t)tmp_int;
#else
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif
}else if(!strcmp(token, "tcp_keepalive")){
#ifdef WITH_BRIDGE
if(!cur_bridge){
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid bridge configuration.");
return MOSQ_ERR_INVAL;
}
if(conf__parse_int(&token, "tcp_keepalive_idle", &tmp_int, &saveptr)) return MOSQ_ERR_INVAL;
if(tmp_int <= 0) {
log__printf(NULL, MOSQ_LOG_ERR, "Error: invalid TCP keepalive idle value.");
return MOSQ_ERR_INVAL;
}
cur_bridge->tcp_keepalive_idle = (unsigned int)tmp_int;
if(conf__parse_int(&token, "tcp_keepalive_interval", &tmp_int, &saveptr)) return MOSQ_ERR_INVAL;
if(tmp_int <= 0) {
log__printf(NULL, MOSQ_LOG_ERR, "Error: invalid TCP keepalive interval value.");
return MOSQ_ERR_INVAL;
}
cur_bridge->tcp_keepalive_interval = (unsigned int)tmp_int;
if(conf__parse_int(&token, "tcp_keepalive_counter", &tmp_int, &saveptr)) return MOSQ_ERR_INVAL;
if(tmp_int <= 0) {
log__printf(NULL, MOSQ_LOG_ERR, "Error: invalid TCP keepalive counter value.");
return MOSQ_ERR_INVAL;
}
cur_bridge->tcp_keepalive_counter = (unsigned int)tmp_int;
#else
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Bridge support not available.");
#endif
}else if(!strcmp(token, "keyfile")){
#ifdef WITH_TLS

Loading…
Cancel
Save