Browse Source

Only set mqtt alpn if mosquitto lib supports it

This fixes a build issue with Debian buster having an older
mosquitto library.
pull/1547/head
Andreas Granig 3 years ago
parent
commit
673c241bb3
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      daemon/mqtt.c

+ 4
- 0
daemon/mqtt.c View File

@ -62,11 +62,15 @@ static int mqtt_connect(void) {
}
if (rtpe_config.mqtt_tls_alpn) {
#if LIBMOSQUITTO_VERSION_NUMBER >= 1006000
int ret = mosquitto_string_option(mosq, MOSQ_OPT_TLS_ALPN, rtpe_config.mqtt_tls_alpn);
if (ret != MOSQ_ERR_SUCCESS) {
ilog(LOG_ERR, "Failed to set mosquitto TLS ALPN options: %s", mosquitto_strerror(errno));
return -1;
}
#else
ilog(LOG_WARN, "Cannot set mqtt TLS ALPN due to outdated mosquitto library");
#endif
}
ret = mosquitto_connect(mosq, rtpe_config.mqtt_host, rtpe_config.mqtt_port,


Loading…
Cancel
Save