From 61871433845f18897df218e08ee40067898e687b Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Sat, 6 Nov 2021 16:10:29 +0300 Subject: [PATCH 01/10] Set ARCHIVE DESTINATION for mosquittopp library Signed-off-by: Konstantin Podsvirov --- lib/cpp/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cpp/CMakeLists.txt b/lib/cpp/CMakeLists.txt index 1748b14c..882b662c 100644 --- a/lib/cpp/CMakeLists.txt +++ b/lib/cpp/CMakeLists.txt @@ -14,7 +14,10 @@ set_target_properties(mosquittopp PROPERTIES VERSION ${VERSION} SOVERSION 1 ) -install(TARGETS mosquittopp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") +install(TARGETS mosquittopp + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") if (WITH_STATIC_LIBRARIES) add_library(mosquittopp_static STATIC From b34817cfab81caac8bab1402b06fc0a492ffd56c Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Sat, 6 Nov 2021 16:18:04 +0300 Subject: [PATCH 02/10] Set ARCHIVE DESTINATION for mosquitto library Signed-off-by: Konstantin Podsvirov --- lib/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 5da221dc..31cc35e3 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -96,7 +96,10 @@ set_target_properties(libmosquitto PROPERTIES SOVERSION 1 ) -install(TARGETS libmosquitto RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") +install(TARGETS libmosquitto + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") if (WITH_STATIC_LIBRARIES) add_library(libmosquitto_static STATIC ${C_SRC}) From c4d51f0835967301be0f13b475aaf33adddc5f54 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Sat, 6 Nov 2021 17:11:09 +0300 Subject: [PATCH 03/10] Fix DESTINATION for mosquitto_dynamic_security MODULE On Windows MODULE will be installed as LIBRARY component to `lib` folder that is not prefer for dynamic loaded modules but can be found in RUNTIME DESTINATION (`bin` folder) too. Signed-off-by: Konstantin Podsvirov --- plugins/dynamic-security/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/dynamic-security/CMakeLists.txt b/plugins/dynamic-security/CMakeLists.txt index 465b99b2..643de1de 100644 --- a/plugins/dynamic-security/CMakeLists.txt +++ b/plugins/dynamic-security/CMakeLists.txt @@ -35,7 +35,12 @@ if (CJSON_FOUND AND WITH_TLS) target_link_libraries(mosquitto_dynamic_security ${CJSON_LIBRARIES} ${OPENSSL_LIBRARIES}) if(WIN32) target_link_libraries(mosquitto_dynamic_security mosquitto) - endif(WIN32) + install(TARGETS mosquitto_dynamic_security + DESTINATION "${CMAKE_INSTALL_BINDIR}") + else() + install(TARGETS mosquitto_dynamic_security + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif() - install(TARGETS mosquitto_dynamic_security RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") endif() From 94d61305fa373466bd96b7810b0789952a3cbc3a Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 9 Nov 2021 13:53:37 +0000 Subject: [PATCH 04/10] Fix bridge not respecting receive-maximum when reconnecting with MQTT v5. --- ChangeLog.txt | 6 ++++++ src/handle_connack.c | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 4a561680..51f94aad 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,9 @@ +2.0.14 - 2021-xx-xx +=================== + +Broker: +- Fix bridge not respecting receive-maximum when reconnecting with MQTT v5. + 2.0.13 - 2021-10-27 =================== diff --git a/src/handle_connack.c b/src/handle_connack.c index 18e40fb8..f4251fe9 100644 --- a/src/handle_connack.c +++ b/src/handle_connack.c @@ -37,6 +37,7 @@ int handle__connack(struct mosquitto *context) uint32_t maximum_packet_size; uint8_t retain_available; uint16_t server_keepalive; + uint16_t inflight_maximum; uint8_t max_qos = 255; if(context == NULL){ @@ -83,9 +84,12 @@ int handle__connack(struct mosquitto *context) } /* receive-maximum */ - mosquitto_property_read_int16(properties, MQTT_PROP_RECEIVE_MAXIMUM, - &context->msgs_out.inflight_maximum, false); - context->msgs_out.inflight_quota = context->msgs_out.inflight_maximum; + inflight_maximum = context->msgs_out.inflight_maximum; + mosquitto_property_read_int16(properties, MQTT_PROP_RECEIVE_MAXIMUM, &inflight_maximum, false); + if(context->msgs_out.inflight_maximum != inflight_maximum){ + context->msgs_out.inflight_maximum = inflight_maximum; + db__message_reconnect_reset(context); + } /* retain-available */ if(mosquitto_property_read_byte(properties, MQTT_PROP_RETAIN_AVAILABLE, From f3590f3020d079d6a26b4c8a452783ad54567b97 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Mon, 15 Nov 2021 22:29:19 +0000 Subject: [PATCH 05/10] Don't pass NULL to printf %s. This is undefined behaviour, and some platforms don't like it. Issue #2355. Thanks to CJ Lee. --- lib/handle_auth.c | 2 +- lib/handle_connack.c | 2 +- lib/handle_ping.c | 6 +++--- lib/handle_pubackcomp.c | 6 +++--- lib/handle_publish.c | 2 +- lib/handle_pubrec.c | 6 +++--- lib/handle_pubrel.c | 4 ++-- lib/handle_suback.c | 4 ++-- lib/handle_unsuback.c | 4 ++-- lib/mosquitto_internal.h | 2 ++ lib/send_connect.c | 4 ++-- lib/send_disconnect.c | 6 +++--- lib/send_mosq.c | 24 ++++++++++++------------ lib/send_publish.c | 8 ++++---- lib/send_subscribe.c | 4 ++-- lib/send_unsubscribe.c | 4 ++-- 16 files changed, 45 insertions(+), 43 deletions(-) diff --git a/lib/handle_auth.c b/lib/handle_auth.c index c1cc6f28..dd8b2f7c 100644 --- a/lib/handle_auth.c +++ b/lib/handle_auth.c @@ -36,7 +36,7 @@ int handle__auth(struct mosquitto *mosq) mosquitto_property *properties = NULL; if(!mosq) return MOSQ_ERR_INVAL; - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received AUTH", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received AUTH", SAFE_PRINT(mosq->id)); if(mosq->protocol != mosq_p_mqtt5){ return MOSQ_ERR_PROTOCOL; diff --git a/lib/handle_connack.c b/lib/handle_connack.c index 4d77e46d..4c2ec00e 100644 --- a/lib/handle_connack.c +++ b/lib/handle_connack.c @@ -32,7 +32,7 @@ Contributors: static void connack_callback(struct mosquitto *mosq, uint8_t reason_code, uint8_t connect_flags, const mosquitto_property *properties) { - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received CONNACK (%d)", mosq->id, reason_code); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received CONNACK (%d)", SAFE_PRINT(mosq->id), reason_code); if(reason_code == MQTT_RC_SUCCESS){ mosq->reconnects = 0; } diff --git a/lib/handle_ping.c b/lib/handle_ping.c index 8ca3646e..545e2784 100644 --- a/lib/handle_ping.c +++ b/lib/handle_ping.c @@ -49,7 +49,7 @@ int handle__pingreq(struct mosquitto *mosq) } #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Received PINGREQ from %s", mosq->id); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PINGREQ from %s", SAFE_PRINT(mosq->id)); #else return MOSQ_ERR_PROTOCOL; #endif @@ -69,9 +69,9 @@ int handle__pingresp(struct mosquitto *mosq) if(mosq->bridge == NULL){ return MOSQ_ERR_PROTOCOL; } - log__printf(NULL, MOSQ_LOG_DEBUG, "Received PINGRESP from %s", mosq->id); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PINGRESP from %s", SAFE_PRINT(mosq->id)); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PINGRESP", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PINGRESP", SAFE_PRINT(mosq->id)); #endif return MOSQ_ERR_SUCCESS; } diff --git a/lib/handle_pubackcomp.c b/lib/handle_pubackcomp.c index 2bc808cd..b2dcf7ee 100644 --- a/lib/handle_pubackcomp.c +++ b/lib/handle_pubackcomp.c @@ -119,20 +119,20 @@ int handle__pubackcomp(struct mosquitto *mosq, const char *type) } #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Received %s from %s (Mid: %d, RC:%d)", type, mosq->id, mid, reason_code); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received %s from %s (Mid: %d, RC:%d)", type, SAFE_PRINT(mosq->id), mid, reason_code); /* Immediately free, we don't do anything with Reason String or User Property at the moment */ mosquitto_property_free_all(&properties); rc = db__message_delete_outgoing(mosq, mid, mosq_ms_wait_for_pubcomp, qos); if(rc == MOSQ_ERR_NOT_FOUND){ - log__printf(mosq, MOSQ_LOG_WARNING, "Warning: Received %s from %s for an unknown packet identifier %d.", type, mosq->id, mid); + log__printf(mosq, MOSQ_LOG_WARNING, "Warning: Received %s from %s for an unknown packet identifier %d.", type, SAFE_PRINT(mosq->id), mid); return MOSQ_ERR_SUCCESS; }else{ return rc; } #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received %s (Mid: %d, RC:%d)", mosq->id, type, mid, reason_code); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received %s (Mid: %d, RC:%d)", SAFE_PRINT(mosq->id), type, mid, reason_code); rc = message__delete(mosq, mid, mosq_md_out, qos); if(rc == MOSQ_ERR_SUCCESS){ diff --git a/lib/handle_publish.c b/lib/handle_publish.c index 5bd2ede7..7864b8af 100644 --- a/lib/handle_publish.c +++ b/lib/handle_publish.c @@ -115,7 +115,7 @@ int handle__publish(struct mosquitto *mosq) } log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", - mosq->id, message->dup, message->msg.qos, message->msg.retain, + SAFE_PRINT(mosq->id), message->dup, message->msg.qos, message->msg.retain, message->msg.mid, message->msg.topic, (long)message->msg.payloadlen); diff --git a/lib/handle_pubrec.c b/lib/handle_pubrec.c index b94ca009..d561b0b4 100644 --- a/lib/handle_pubrec.c +++ b/lib/handle_pubrec.c @@ -90,7 +90,7 @@ int handle__pubrec(struct mosquitto *mosq) } #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREC from %s (Mid: %d)", mosq->id, mid); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREC from %s (Mid: %d)", SAFE_PRINT(mosq->id), mid); if(reason_code < 0x80){ rc = db__message_update_outgoing(mosq, mid, mosq_ms_wait_for_pubcomp, 2); @@ -99,7 +99,7 @@ int handle__pubrec(struct mosquitto *mosq) } #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREC (Mid: %d)", mosq->id, mid); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREC (Mid: %d)", SAFE_PRINT(mosq->id), mid); if(reason_code < 0x80 || mosq->protocol != mosq_p_mqtt5){ rc = message__out_update(mosq, mid, mosq_ms_wait_for_pubcomp, 2); @@ -122,7 +122,7 @@ int handle__pubrec(struct mosquitto *mosq) } #endif if(rc == MOSQ_ERR_NOT_FOUND){ - log__printf(mosq, MOSQ_LOG_WARNING, "Warning: Received PUBREC from %s for an unknown packet identifier %d.", mosq->id, mid); + log__printf(mosq, MOSQ_LOG_WARNING, "Warning: Received PUBREC from %s for an unknown packet identifier %d.", SAFE_PRINT(mosq->id), mid); }else if(rc != MOSQ_ERR_SUCCESS){ return rc; } diff --git a/lib/handle_pubrel.c b/lib/handle_pubrel.c index cdbebf4a..010f970c 100644 --- a/lib/handle_pubrel.c +++ b/lib/handle_pubrel.c @@ -88,7 +88,7 @@ int handle__pubrel(struct mosquitto *mosq) } #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREL from %s (Mid: %d)", mosq->id, mid); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received PUBREL from %s (Mid: %d)", SAFE_PRINT(mosq->id), mid); /* Immediately free, we don't do anything with Reason String or User Property at the moment */ mosquitto_property_free_all(&properties); @@ -104,7 +104,7 @@ int handle__pubrel(struct mosquitto *mosq) rc = send__pubcomp(mosq, mid, NULL); if(rc) return rc; #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREL (Mid: %d)", mosq->id, mid); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received PUBREL (Mid: %d)", SAFE_PRINT(mosq->id), mid); rc = send__pubcomp(mosq, mid, NULL); if(rc){ diff --git a/lib/handle_suback.c b/lib/handle_suback.c index 5d3a4051..64a90135 100644 --- a/lib/handle_suback.c +++ b/lib/handle_suback.c @@ -59,9 +59,9 @@ int handle__suback(struct mosquitto *mosq) /* Client is not a bridge, so shouldn't be sending SUBACK */ return MOSQ_ERR_PROTOCOL; } - log__printf(NULL, MOSQ_LOG_DEBUG, "Received SUBACK from %s", mosq->id); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received SUBACK from %s", SAFE_PRINT(mosq->id)); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received SUBACK", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received SUBACK", SAFE_PRINT(mosq->id)); #endif rc = packet__read_uint16(&mosq->in_packet, &mid); if(rc) return rc; diff --git a/lib/handle_unsuback.c b/lib/handle_unsuback.c index 5b004046..bc92cb04 100644 --- a/lib/handle_unsuback.c +++ b/lib/handle_unsuback.c @@ -59,9 +59,9 @@ int handle__unsuback(struct mosquitto *mosq) /* Client is not a bridge, so shouldn't be sending SUBACK */ return MOSQ_ERR_PROTOCOL; } - log__printf(NULL, MOSQ_LOG_DEBUG, "Received UNSUBACK from %s", mosq->id); + log__printf(NULL, MOSQ_LOG_DEBUG, "Received UNSUBACK from %s", SAFE_PRINT(mosq->id)); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received UNSUBACK", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s received UNSUBACK", SAFE_PRINT(mosq->id)); #endif rc = packet__read_uint16(&mosq->in_packet, &mid); if(rc) return rc; diff --git a/lib/mosquitto_internal.h b/lib/mosquitto_internal.h index e26ded7c..8d066388 100644 --- a/lib/mosquitto_internal.h +++ b/lib/mosquitto_internal.h @@ -72,6 +72,8 @@ typedef SOCKET mosq_sock_t; typedef int mosq_sock_t; #endif +#define SAFE_PRINT(A) (A)?(A):"null" + enum mosquitto_msg_direction { mosq_md_in = 0, mosq_md_out = 1 diff --git a/lib/send_connect.c b/lib/send_connect.c index d9a3257c..0976d497 100644 --- a/lib/send_connect.c +++ b/lib/send_connect.c @@ -204,10 +204,10 @@ int send__connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session mosq->keepalive = keepalive; #ifdef WITH_BROKER # ifdef WITH_BRIDGE - log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending CONNECT", clientid); + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending CONNECT", SAFE_PRINT(clientid)); # endif #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending CONNECT", clientid); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending CONNECT", SAFE_PRINT(clientid)); #endif return packet__queue(mosq, packet); } diff --git a/lib/send_disconnect.c b/lib/send_disconnect.c index db2efe08..83ec2ea4 100644 --- a/lib/send_disconnect.c +++ b/lib/send_disconnect.c @@ -43,15 +43,15 @@ int send__disconnect(struct mosquitto *mosq, uint8_t reason_code, const mosquitt #ifdef WITH_BROKER # ifdef WITH_BRIDGE if(mosq->bridge){ - log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending DISCONNECT", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending DISCONNECT", SAFE_PRINT(mosq->id)); }else # else { - log__printf(mosq, MOSQ_LOG_DEBUG, "Sending DISCONNECT to %s (rc%d)", mosq->id, reason_code); + log__printf(mosq, MOSQ_LOG_DEBUG, "Sending DISCONNECT to %s (rc%d)", SAFE_PRINT(mosq->id), reason_code); } # endif #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending DISCONNECT", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending DISCONNECT", SAFE_PRINT(mosq->id)); #endif assert(mosq); packet = mosquitto__calloc(1, sizeof(struct mosquitto__packet)); diff --git a/lib/send_mosq.c b/lib/send_mosq.c index f4a3ef39..a8346495 100644 --- a/lib/send_mosq.c +++ b/lib/send_mosq.c @@ -46,9 +46,9 @@ int send__pingreq(struct mosquitto *mosq) int rc; assert(mosq); #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGREQ to %s", mosq->id); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGREQ to %s", SAFE_PRINT(mosq->id)); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGREQ", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGREQ", SAFE_PRINT(mosq->id)); #endif rc = send__simple_command(mosq, CMD_PINGREQ); if(rc == MOSQ_ERR_SUCCESS){ @@ -60,9 +60,9 @@ int send__pingreq(struct mosquitto *mosq) int send__pingresp(struct mosquitto *mosq) { #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGRESP to %s", mosq->id); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PINGRESP to %s", SAFE_PRINT(mosq->id)); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGRESP", mosq->id); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PINGRESP", SAFE_PRINT(mosq->id)); #endif return send__simple_command(mosq, CMD_PINGRESP); } @@ -70,9 +70,9 @@ int send__pingresp(struct mosquitto *mosq) int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, const mosquitto_property *properties) { #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBACK to %s (m%d, rc%d)", mosq->id, mid, reason_code); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBACK to %s (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBACK (m%d, rc%d)", mosq->id, mid, reason_code); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBACK (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code); #endif util__increment_receive_quota(mosq); /* We don't use Reason String or User Property yet. */ @@ -82,9 +82,9 @@ int send__puback(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, cons int send__pubcomp(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties) { #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBCOMP to %s (m%d)", mosq->id, mid); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBCOMP to %s (m%d)", SAFE_PRINT(mosq->id), mid); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBCOMP (m%d)", mosq->id, mid); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBCOMP (m%d)", SAFE_PRINT(mosq->id), mid); #endif util__increment_receive_quota(mosq); /* We don't use Reason String or User Property yet. */ @@ -95,9 +95,9 @@ int send__pubcomp(struct mosquitto *mosq, uint16_t mid, const mosquitto_property int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, const mosquitto_property *properties) { #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREC to %s (m%d, rc%d)", mosq->id, mid, reason_code); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREC to %s (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREC (m%d, rc%d)", mosq->id, mid, reason_code); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREC (m%d, rc%d)", SAFE_PRINT(mosq->id), mid, reason_code); #endif if(reason_code >= 0x80 && mosq->protocol == mosq_p_mqtt5){ util__increment_receive_quota(mosq); @@ -109,9 +109,9 @@ int send__pubrec(struct mosquitto *mosq, uint16_t mid, uint8_t reason_code, cons int send__pubrel(struct mosquitto *mosq, uint16_t mid, const mosquitto_property *properties) { #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREL to %s (m%d)", mosq->id, mid); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBREL to %s (m%d)", SAFE_PRINT(mosq->id), mid); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREL (m%d)", mosq->id, mid); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBREL (m%d)", SAFE_PRINT(mosq->id), mid); #endif /* We don't use Reason String or User Property yet. */ return send__command_with_mid(mosq, CMD_PUBREL|2, mid, false, 0, properties); diff --git a/lib/send_publish.c b/lib/send_publish.c index 148ee29c..1b5ffdaa 100644 --- a/lib/send_publish.c +++ b/lib/send_publish.c @@ -114,7 +114,7 @@ int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint3 mosquitto__free(mapped_topic); mapped_topic = topic_temp; } - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, mapped_topic, (long)payloadlen); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", SAFE_PRINT(mosq->id), dup, qos, retain, mid, mapped_topic, (long)payloadlen); G_PUB_BYTES_SENT_INC(payloadlen); rc = send__real_publish(mosq, mid, mapped_topic, payloadlen, payload, qos, retain, dup, cmsg_props, store_props, expiry_interval); mosquitto__free(mapped_topic); @@ -124,10 +124,10 @@ int send__publish(struct mosquitto *mosq, uint16_t mid, const char *topic, uint3 } } #endif - log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, topic, (long)payloadlen); + log__printf(NULL, MOSQ_LOG_DEBUG, "Sending PUBLISH to %s (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", SAFE_PRINT(mosq->id), dup, qos, retain, mid, topic, (long)payloadlen); G_PUB_BYTES_SENT_INC(payloadlen); #else - log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", mosq->id, dup, qos, retain, mid, topic, (long)payloadlen); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending PUBLISH (d%d, q%d, r%d, m%d, '%s', ... (%ld bytes))", SAFE_PRINT(mosq->id), dup, qos, retain, mid, topic, (long)payloadlen); #endif return send__real_publish(mosq, mid, topic, payloadlen, payload, qos, retain, dup, cmsg_props, store_props, expiry_interval); @@ -175,7 +175,7 @@ int send__real_publish(struct mosquitto *mosq, uint16_t mid, const char *topic, } if(packet__check_oversize(mosq, packetlen)){ #ifdef WITH_BROKER - log__printf(NULL, MOSQ_LOG_NOTICE, "Dropping too large outgoing PUBLISH for %s (%d bytes)", mosq->id, packetlen); + log__printf(NULL, MOSQ_LOG_NOTICE, "Dropping too large outgoing PUBLISH for %s (%d bytes)", SAFE_PRINT(mosq->id), packetlen); #else log__printf(NULL, MOSQ_LOG_NOTICE, "Dropping too large outgoing PUBLISH (%d bytes)", packetlen); #endif diff --git a/lib/send_subscribe.c b/lib/send_subscribe.c index 9217dc5b..40e1d432 100644 --- a/lib/send_subscribe.c +++ b/lib/send_subscribe.c @@ -89,11 +89,11 @@ int send__subscribe(struct mosquitto *mosq, int *mid, int topic_count, char *con #ifdef WITH_BROKER # ifdef WITH_BRIDGE - log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d, Options: 0x%02x)", mosq->id, local_mid, topic[0], topic_qos&0x03, topic_qos&0xFC); + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d, Options: 0x%02x)", SAFE_PRINT(mosq->id), local_mid, topic[0], topic_qos&0x03, topic_qos&0xFC); # endif #else for(i=0; iid, local_mid, topic[i], topic_qos&0x03, topic_qos&0xFC); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending SUBSCRIBE (Mid: %d, Topic: %s, QoS: %d, Options: 0x%02x)", SAFE_PRINT(mosq->id), local_mid, topic[i], topic_qos&0x03, topic_qos&0xFC); } #endif diff --git a/lib/send_unsubscribe.c b/lib/send_unsubscribe.c index 654f0ebe..0806b819 100644 --- a/lib/send_unsubscribe.c +++ b/lib/send_unsubscribe.c @@ -89,12 +89,12 @@ int send__unsubscribe(struct mosquitto *mosq, int *mid, int topic_count, char *c #ifdef WITH_BROKER # ifdef WITH_BRIDGE for(i=0; iid, local_mid, topic[i]); + log__printf(mosq, MOSQ_LOG_DEBUG, "Bridge %s sending UNSUBSCRIBE (Mid: %d, Topic: %s)", SAFE_PRINT(mosq->id), local_mid, topic[i]); } # endif #else for(i=0; iid, local_mid, topic[i]); + log__printf(mosq, MOSQ_LOG_DEBUG, "Client %s sending UNSUBSCRIBE (Mid: %d, Topic: %s)", SAFE_PRINT(mosq->id), local_mid, topic[i]); } #endif return packet__queue(mosq, packet); From 0d0a36906c042bae3b5827c177411d9c9182440c Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 16 Nov 2021 22:14:19 +0000 Subject: [PATCH 06/10] Add missing stubs. --- test/unit/persist_read_stubs.c | 8 ++++++++ test/unit/persist_write_stubs.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/test/unit/persist_read_stubs.c b/test/unit/persist_read_stubs.c index 31724b89..2d088ac7 100644 --- a/test/unit/persist_read_stubs.c +++ b/test/unit/persist_read_stubs.c @@ -197,3 +197,11 @@ void db__msg_add_to_queued_stats(struct mosquitto_msg_data *msg_data, struct mos UNUSED(msg_data); UNUSED(msg); } + +void context__add_to_by_id(struct mosquitto *context) +{ + if(context->in_by_id == false){ + context->in_by_id = true; + HASH_ADD_KEYPTR(hh_id, db.contexts_by_id, context->id, strlen(context->id), context); + } +} diff --git a/test/unit/persist_write_stubs.c b/test/unit/persist_write_stubs.c index 173cd4ea..5cc4a597 100644 --- a/test/unit/persist_write_stubs.c +++ b/test/unit/persist_write_stubs.c @@ -113,3 +113,11 @@ int send__pubrel(struct mosquitto *mosq, uint16_t mid, const mosquitto_property return MOSQ_ERR_SUCCESS; } + +void context__add_to_by_id(struct mosquitto *context) +{ + if(context->in_by_id == false){ + context->in_by_id = true; + HASH_ADD_KEYPTR(hh_id, db.contexts_by_id, context->id, strlen(context->id), context); + } +} From 11975332d4ef4c020a598d2a194d4dfe26596e24 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 16 Nov 2021 23:14:24 +0000 Subject: [PATCH 07/10] Fix mosquitto_topic_matches_sub2() not using the length parameters. Closes #2364. Thanks to Jens Alfke. --- ChangeLog.txt | 5 ++ lib/util_topic.c | 137 +++++++++++++++++++++++++++++++++--- test/unit/util_topic_test.c | 17 +++++ 3 files changed, 150 insertions(+), 9 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 51f94aad..3448f9a0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -4,6 +4,11 @@ Broker: - Fix bridge not respecting receive-maximum when reconnecting with MQTT v5. +Client library: +- Fix mosquitto_topic_matches_sub2() not using the length parameters. + Closes #2364. + + 2.0.13 - 2021-10-27 =================== diff --git a/lib/util_topic.c b/lib/util_topic.c index 62b53112..e29102f7 100644 --- a/lib/util_topic.c +++ b/lib/util_topic.c @@ -189,19 +189,11 @@ int mosquitto_sub_topic_check2(const char *str, size_t len) return MOSQ_ERR_SUCCESS; } -int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result) -{ - return mosquitto_topic_matches_sub2(sub, 0, topic, 0, result); -} - /* Does a topic match a subscription? */ -int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result) +int mosquitto_topic_matches_sub(const char *sub, const char *topic, bool *result) { size_t spos; - UNUSED(sublen); - UNUSED(topiclen); - if(!result) return MOSQ_ERR_INVAL; *result = false; @@ -325,3 +317,130 @@ int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *top return MOSQ_ERR_SUCCESS; } + +/* Does a topic match a subscription? */ +int mosquitto_topic_matches_sub2(const char *sub, size_t sublen, const char *topic, size_t topiclen, bool *result) +{ + size_t spos, tpos; + + if(!result) return MOSQ_ERR_INVAL; + *result = false; + + if(!sub || !topic || !sublen || !topiclen){ + return MOSQ_ERR_INVAL; + } + + if((sub[0] == '$' && topic[0] != '$') + || (topic[0] == '$' && sub[0] != '$')){ + + return MOSQ_ERR_SUCCESS; + } + + spos = 0; + tpos = 0; + + while(spos < sublen){ + if(tpos < topiclen && (topic[tpos] == '+' || topic[tpos] == '#')){ + return MOSQ_ERR_INVAL; + } + if(tpos == topiclen || sub[spos] != topic[tpos]){ + if(sub[spos] == '+'){ + /* Check for bad "+foo" or "a/+foo" subscription */ + if(spos > 0 && sub[spos-1] != '/'){ + return MOSQ_ERR_INVAL; + } + /* Check for bad "foo+" or "foo+/a" subscription */ + if(spos+1 < sublen && sub[spos+1] != '/'){ + return MOSQ_ERR_INVAL; + } + spos++; + while(tpos < topiclen && topic[tpos] != '/'){ + if(topic[tpos] == '+' || topic[tpos] == '#'){ + return MOSQ_ERR_INVAL; + } + tpos++; + } + if(tpos == topiclen && spos == sublen){ + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else if(sub[spos] == '#'){ + /* Check for bad "foo#" subscription */ + if(spos > 0 && sub[spos-1] != '/'){ + return MOSQ_ERR_INVAL; + } + /* Check for # not the final character of the sub, e.g. "#foo" */ + if(spos+1 < sublen){ + return MOSQ_ERR_INVAL; + }else{ + while(tpos < topiclen){ + if(topic[tpos] == '+' || topic[tpos] == '#'){ + return MOSQ_ERR_INVAL; + } + tpos++; + } + *result = true; + return MOSQ_ERR_SUCCESS; + } + }else{ + /* Check for e.g. foo/bar matching foo/+/# */ + if(tpos == topiclen + && spos > 0 + && sub[spos-1] == '+' + && sub[spos] == '/' + && spos+1 < sublen + && sub[spos+1] == '#') + { + *result = true; + return MOSQ_ERR_SUCCESS; + } + + /* There is no match at this point, but is the sub invalid? */ + while(spos < sublen){ + if(sub[spos] == '#' && spos+1 < sublen){ + return MOSQ_ERR_INVAL; + } + spos++; + } + + /* Valid input, but no match */ + return MOSQ_ERR_SUCCESS; + } + }else{ + /* sub[spos] == topic[tpos] */ + if(tpos+1 == topiclen){ + /* Check for e.g. foo matching foo/# */ + if(spos+3 == sublen + && sub[spos+1] == '/' + && sub[spos+2] == '#'){ + *result = true; + return MOSQ_ERR_SUCCESS; + } + } + spos++; + tpos++; + if(spos == sublen && tpos == topiclen){ + *result = true; + return MOSQ_ERR_SUCCESS; + }else if(tpos == topiclen && sub[spos] == '+' && spos+1 == sublen){ + if(spos > 0 && sub[spos-1] != '/'){ + return MOSQ_ERR_INVAL; + } + spos++; + *result = true; + return MOSQ_ERR_SUCCESS; + } + } + } + if(tpos < topiclen || spos < sublen){ + *result = false; + } + while(tpos < topiclen){ + if(topic[tpos] == '+' || topic[tpos] == '#'){ + return MOSQ_ERR_INVAL; + } + tpos++; + } + + return MOSQ_ERR_SUCCESS; +} diff --git a/test/unit/util_topic_test.c b/test/unit/util_topic_test.c index b669fcc9..df5ee697 100644 --- a/test/unit/util_topic_test.c +++ b/test/unit/util_topic_test.c @@ -11,6 +11,16 @@ static void match_helper(const char *sub, const char *topic) rc = mosquitto_topic_matches_sub(sub, topic, &match); CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); CU_ASSERT_EQUAL(match, true); + if(match == false){ + printf("1: %s:%s\n", sub, topic); + } + + rc = mosquitto_topic_matches_sub2(sub, strlen(sub), topic, strlen(topic), &match); + CU_ASSERT_EQUAL(rc, MOSQ_ERR_SUCCESS); + CU_ASSERT_EQUAL(match, true); + if(match == false){ + printf("2: %s:%s\n", sub, topic); + } } static void no_match_helper(int rc_expected, const char *sub, const char *topic) @@ -24,6 +34,13 @@ static void no_match_helper(int rc_expected, const char *sub, const char *topic) printf("%d:%d %s:%s\n", rc, rc_expected, sub, topic); } CU_ASSERT_EQUAL(match, false); + + rc = mosquitto_topic_matches_sub2(sub, strlen(sub), topic, strlen(topic), &match); + CU_ASSERT_EQUAL(rc, rc_expected); + if(rc != rc_expected){ + printf("%d:%d %s:%s\n", rc, rc_expected, sub, topic); + } + CU_ASSERT_EQUAL(match, false); } /* ======================================================================== From 9c4f17aa619c72519240a028b6b1122ccdbbb085 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 17 Nov 2021 00:02:09 +0000 Subject: [PATCH 08/10] Remove broken websockets static compiling option. --- config.mk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config.mk b/config.mk index 8fbb94ea..aaa96fc5 100644 --- a/config.mk +++ b/config.mk @@ -333,11 +333,6 @@ ifeq ($(WITH_WEBSOCKETS),yes) BROKER_LDADD:=$(BROKER_LDADD) -lwebsockets endif -ifeq ($(WITH_WEBSOCKETS),static) - BROKER_CPPFLAGS:=$(BROKER_CPPFLAGS) -DWITH_WEBSOCKETS - BROKER_LDADD:=$(BROKER_LDADD) -static -lwebsockets -endif - INSTALL?=install prefix?=/usr/local incdir?=${prefix}/include From 94fcd470d0f9cbd877bbfe4f21ffe7eed064204d Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 17 Nov 2021 00:23:04 +0000 Subject: [PATCH 09/10] Fix incorrect subscribe_callback in mosquittopp.h. Closes #2367. Thanks to Jens Alfke. --- ChangeLog.txt | 1 + lib/cpp/mosquittopp.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3448f9a0..717f70c2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,7 @@ Broker: Client library: - Fix mosquitto_topic_matches_sub2() not using the length parameters. Closes #2364. +- Fix incorrect subscribe_callback in mosquittopp.h. Closes #2367. 2.0.13 - 2021-10-27 diff --git a/lib/cpp/mosquittopp.h b/lib/cpp/mosquittopp.h index be9016d6..f47535a9 100644 --- a/lib/cpp/mosquittopp.h +++ b/lib/cpp/mosquittopp.h @@ -64,7 +64,6 @@ mosqpp_EXPORT int subscribe_callback( void *userdata, const char *topic, int qos=0, - bool retained=true, const char *host="localhost", int port=1883, const char *client_id=NULL, From 2a056f14c2b413a82768935967319326223bfe99 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 17 Nov 2021 00:26:03 +0000 Subject: [PATCH 10/10] Bump version number, update web. --- CMakeLists.txt | 2 +- ChangeLog.txt | 2 +- config.mk | 2 +- include/mosquitto.h | 2 +- installer/mosquitto.nsi | 2 +- installer/mosquitto64.nsi | 2 +- set-version.sh | 2 +- snap/snapcraft.yaml | 2 +- www/pages/download.md | 6 ++--- www/posts/2021/11/version-2-0-14-released.md | 23 ++++++++++++++++++++ 10 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 www/posts/2021/11/version-2-0-14-released.md diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c795f6e..2775a3da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.0) cmake_policy(SET CMP0042 NEW) project(mosquitto) -set (VERSION 2.0.13) +set (VERSION 2.0.14) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") diff --git a/ChangeLog.txt b/ChangeLog.txt index 717f70c2..d202f4d0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,4 @@ -2.0.14 - 2021-xx-xx +2.0.14 - 2021-11-17 =================== Broker: diff --git a/config.mk b/config.mk index aaa96fc5..3cb2cc5e 100644 --- a/config.mk +++ b/config.mk @@ -127,7 +127,7 @@ WITH_XTREPORT=no # Also bump lib/mosquitto.h, CMakeLists.txt, # installer/mosquitto.nsi, installer/mosquitto64.nsi -VERSION=2.0.13 +VERSION=2.0.14 # Client library SO version. Bump if incompatible API/ABI changes are made. SOVERSION=1 diff --git a/include/mosquitto.h b/include/mosquitto.h index fc1e2a6c..e514d3f6 100644 --- a/include/mosquitto.h +++ b/include/mosquitto.h @@ -66,7 +66,7 @@ extern "C" { #define LIBMOSQUITTO_MAJOR 2 #define LIBMOSQUITTO_MINOR 0 -#define LIBMOSQUITTO_REVISION 13 +#define LIBMOSQUITTO_REVISION 14 /* LIBMOSQUITTO_VERSION_NUMBER looks like 1002001 for e.g. version 1.2.1. */ #define LIBMOSQUITTO_VERSION_NUMBER (LIBMOSQUITTO_MAJOR*1000000+LIBMOSQUITTO_MINOR*1000+LIBMOSQUITTO_REVISION) diff --git a/installer/mosquitto.nsi b/installer/mosquitto.nsi index 42d40c8a..eb845857 100644 --- a/installer/mosquitto.nsi +++ b/installer/mosquitto.nsi @@ -9,7 +9,7 @@ !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' Name "Eclipse Mosquitto" -!define VERSION 2.0.13 +!define VERSION 2.0.14 OutFile "mosquitto-${VERSION}-install-windows-x86.exe" InstallDir "$PROGRAMFILES\mosquitto" diff --git a/installer/mosquitto64.nsi b/installer/mosquitto64.nsi index 1edb8468..d357df4d 100644 --- a/installer/mosquitto64.nsi +++ b/installer/mosquitto64.nsi @@ -9,7 +9,7 @@ !define env_hklm 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"' Name "Eclipse Mosquitto" -!define VERSION 2.0.13 +!define VERSION 2.0.14 OutFile "mosquitto-${VERSION}-install-windows-x64.exe" !include "x64.nsh" diff --git a/set-version.sh b/set-version.sh index 104983be..5f9ae4df 100755 --- a/set-version.sh +++ b/set-version.sh @@ -2,7 +2,7 @@ MAJOR=2 MINOR=0 -REVISION=13 +REVISION=14 sed -i "s/^VERSION=.*/VERSION=${MAJOR}.${MINOR}.${REVISION}/" config.mk diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 095c121c..22f38047 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: mosquitto -version: 2.0.13 +version: 2.0.14 summary: Eclipse Mosquitto MQTT broker description: This is a message broker that supports version 5.0, 3.1.1, and 3.1 of the MQTT protocol. diff --git a/www/pages/download.md b/www/pages/download.md index 151e4eb6..38efe0c4 100644 --- a/www/pages/download.md +++ b/www/pages/download.md @@ -11,7 +11,7 @@ # Source -* [mosquitto-2.0.13.tar.gz](https://mosquitto.org/files/source/mosquitto-2.0.13.tar.gz) ([GPG signature](https://mosquitto.org/files/source/mosquitto-2.0.13.tar.gz.asc)) +* [mosquitto-2.0.14.tar.gz](https://mosquitto.org/files/source/mosquitto-2.0.14.tar.gz) ([GPG signature](https://mosquitto.org/files/source/mosquitto-2.0.14.tar.gz.asc)) * [Git source code repository](https://github.com/eclipse/mosquitto) (github.com) Older downloads are available at [https://mosquitto.org/files/](../files/) @@ -24,8 +24,8 @@ distributions. ## Windows -* [mosquitto-2.0.13-install-windows-x64.exe](https://mosquitto.org/files/binary/win64/mosquitto-2.0.13-install-windows-x64.exe) (64-bit build, Windows Vista and up, built with Visual Studio Community 2019) -* [mosquitto-2.0.13-install-windows-x32.exe](https://mosquitto.org/files/binary/win32/mosquitto-2.0.13-install-windows-x86.exe) (32-bit build, Windows Vista and up, built with Visual Studio Community 2019) +* [mosquitto-2.0.14-install-windows-x64.exe](https://mosquitto.org/files/binary/win64/mosquitto-2.0.14-install-windows-x64.exe) (64-bit build, Windows Vista and up, built with Visual Studio Community 2019) +* [mosquitto-2.0.14-install-windows-x32.exe](https://mosquitto.org/files/binary/win32/mosquitto-2.0.14-install-windows-x86.exe) (32-bit build, Windows Vista and up, built with Visual Studio Community 2019) Older installers can be found at [https://mosquitto.org/files/binary/](https://mosquitto.org/files/binary/). diff --git a/www/posts/2021/11/version-2-0-14-released.md b/www/posts/2021/11/version-2-0-14-released.md new file mode 100644 index 00000000..70e43196 --- /dev/null +++ b/www/posts/2021/11/version-2-0-14-released.md @@ -0,0 +1,23 @@ + + +Versions 2.0.14 of Mosquitto has been released. This is a bugfix release. + +# Broker +- Fix bridge not respecting receive-maximum when reconnecting with MQTT v5. + +# Client library +- Fix `mosquitto_topic_matches_sub2()` not using the length parameters. + Closes [#2364]. +- Fix incorrect `subscribe_callback` in mosquittopp.h. Closes [#2367]. + +[#2364]: https://github.com/eclipse/mosquitto/issues/2364 +[#2367]: https://github.com/eclipse/mosquitto/issues/2367