From 6e3738dcf06a08147d16276ff56b9ace41ab993f Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 26 Jan 2021 13:19:08 +0000 Subject: [PATCH] Fix bridges not always connecting on Windows. Closes #2043. Thanks to ttsorensen. --- ChangeLog.txt | 1 + lib/net_mosq.c | 2 +- src/bridge.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index efdbc9ff..4483a2e3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -15,6 +15,7 @@ Broker: already been configured on the broker. This has been fixed to send a protocol error, as per section 3.3.4 of the specification. - Note in the man pages that SIGHUP reloads TLS certificates. Closes #2037. +- Fix bridges not always connecting on Windows. Closes #2043. Apps: - Allow command line arguments to override config file options in diff --git a/lib/net_mosq.c b/lib/net_mosq.c index cb5bf2ab..d42d83a7 100644 --- a/lib/net_mosq.c +++ b/lib/net_mosq.c @@ -942,7 +942,7 @@ int net__socket_connect(struct mosquitto *mosq, const char *host, uint16_t port, if(rc2) return rc2; } - return MOSQ_ERR_SUCCESS; + return rc; } diff --git a/src/bridge.c b/src/bridge.c index 6eda9cf8..d10d1269 100644 --- a/src/bridge.c +++ b/src/bridge.c @@ -62,7 +62,7 @@ void bridge__start_all(void) int i; for(i=0; ibridge_count; i++){ - if(bridge__new(&(db.config->bridges[i]))){ + if(bridge__new(&(db.config->bridges[i])) > 0){ log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to connect to bridge %s.", db.config->bridges[i].name); }