Skip to content

Commit

Permalink
Merge branch 'fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Dec 22, 2020
2 parents ec1cad0 + 5a565da commit 7fc4722
Show file tree
Hide file tree
Showing 21 changed files with 314 additions and 80 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.0)
cmake_policy(SET CMP0042 NEW)

project(mosquitto)
set (VERSION 2.0.3)
set (VERSION 2.0.4)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")

Expand Down
18 changes: 18 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
2.0.4 - 2020-12-22
==================

Broker:
- Fix $SYS/broker/publish/messages/+ counters not being updated for QoS 1, 2
messages. Closes #1968.
- mosquitto_connect_bind_async() and mosquitto_connect_bind_v5() should not
reset the bind address option if called with bind_address == NULL.
- Fix dynamic security configuration possibly not being reloaded on Windows
only. Closes #1962.
- Add more log messages for dynsec load/save error conditions.
- Fix websockets connections blocking non-websockets connections on Windows.
Closes #1934.

Build:
- Fix man pages not being built when using CMake. Closes #1969.


2.0.3 - 2020-12-17
==================

Expand Down
2 changes: 1 addition & 1 deletion config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ WITH_XTREPORT=no

# Also bump lib/mosquitto.h, CMakeLists.txt,
# installer/mosquitto.nsi, installer/mosquitto64.nsi
VERSION=2.0.3
VERSION=2.0.4

# Client library SO version. Bump if incompatible API/ABI changes are made.
SOVERSION=1
Expand Down
13 changes: 10 additions & 3 deletions include/mosquitto.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ SPDX-License-Identifier: EPL-2.0 OR EDL-1.0
#ifndef MOSQUITTO_H
#define MOSQUITTO_H

/*
* File: mosquitto.h
*
* This header contains functions and definitions for use with libmosquitto, the Mosquitto client library.
*
* The definitions are also used in Mosquitto broker plugins, and some functions are available to plugins.
*/
#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -59,7 +66,7 @@ extern "C" {

#define LIBMOSQUITTO_MAJOR 2
#define LIBMOSQUITTO_MINOR 0
#define LIBMOSQUITTO_REVISION 3
#define LIBMOSQUITTO_REVISION 4
/* 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)

Expand Down Expand Up @@ -3059,8 +3066,8 @@ libmosq_EXPORT void mosquitto_property_free_all(mosquitto_property **properties)
* Function: mosquitto_property_copy_all
*
* Parameters:
* dest : pointer for new property list
* src : property list
* dest - pointer for new property list
* src - property list
*
* Returns:
* MOSQ_ERR_SUCCESS - on successful copy
Expand Down
105 changes: 90 additions & 15 deletions include/mosquitto_broker.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ SPDX-License-Identifier: EPL-2.0 OR EDL-1.0
Roger Light - initial implementation and documentation.
*/

/*
* File: mosquitto_broker.h
*
* This header contains functions for use by plugins.
*/
#ifndef MOSQUITTO_BROKER_H
#define MOSQUITTO_BROKER_H

Expand Down Expand Up @@ -44,7 +49,7 @@ enum mosquitto_protocol {

/* =========================================================================
*
* Register callbacks.
* Section: Register callbacks.
*
* ========================================================================= */

Expand Down Expand Up @@ -172,6 +177,31 @@ typedef struct mosquitto_plugin_id_t mosquitto_plugin_id_t;

/*
* Function: mosquitto_callback_register
*
* Register a callback for an event.
*
* Parameters:
* identifier - the plugin identifier, as provided by <mosquitto_plugin_init>.
* event - the event to register a callback for. Can be one of:
* * MOSQ_EVT_RELOAD
* * MOSQ_EVT_ACL_CHECK
* * MOSQ_EVT_BASIC_AUTH
* * MOSQ_EVT_EXT_AUTH_START
* * MOSQ_EVT_EXT_AUTH_CONTINUE
* * MOSQ_EVT_CONTROL
* * MOSQ_EVT_MESSAGE
* * MOSQ_EVT_PSK_KEY
* * MOSQ_EVT_TICK
* * MOSQ_EVT_DISCONNECT
* cb_func - the callback function
* event_data - event specific data
*
* Returns:
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_INVAL - if cb_func is NULL
* MOSQ_ERR_NOMEM - on out of memory
* MOSQ_ERR_ALREADY_EXISTS - if cb_func has already been registered for this event
* MOSQ_ERR_NOT_SUPPORTED - if the event is not supported
*/
mosq_EXPORT int mosquitto_callback_register(
mosquitto_plugin_id_t *identifier,
Expand All @@ -182,6 +212,30 @@ mosq_EXPORT int mosquitto_callback_register(

/*
* Function: mosquitto_callback_unregister
*
* Unregister a previously registered callback function.
*
* Parameters:
* identifier - the plugin identifier, as provided by <mosquitto_plugin_init>.
* event - the event to register a callback for. Can be one of:
* * MOSQ_EVT_RELOAD
* * MOSQ_EVT_ACL_CHECK
* * MOSQ_EVT_BASIC_AUTH
* * MOSQ_EVT_EXT_AUTH_START
* * MOSQ_EVT_EXT_AUTH_CONTINUE
* * MOSQ_EVT_CONTROL
* * MOSQ_EVT_MESSAGE
* * MOSQ_EVT_PSK_KEY
* * MOSQ_EVT_TICK
* * MOSQ_EVT_DISCONNECT
* cb_func - the callback function
* event_data - event specific data
*
* Returns:
* MOSQ_ERR_SUCCESS - on success
* MOSQ_ERR_INVAL - if cb_func is NULL
* MOSQ_ERR_NOT_FOUND - if cb_func was not registered for this event
* MOSQ_ERR_NOT_SUPPORTED - if the event is not supported
*/
mosq_EXPORT int mosquitto_callback_unregister(
mosquitto_plugin_id_t *identifier,
Expand All @@ -192,21 +246,41 @@ mosq_EXPORT int mosquitto_callback_unregister(

/* =========================================================================
*
* Memory allocation.
* Section: Memory allocation.
*
* Use these functions when allocating or freeing memory to have your memory
* included in the memory tracking on the broker.
*
* ========================================================================= */

/*
* Function: mosquitto_calloc
*/
mosq_EXPORT void *mosquitto_calloc(size_t nmemb, size_t size);

/*
* Function: mosquitto_free
*/
mosq_EXPORT void mosquitto_free(void *mem);

/*
* Function: mosquitto_malloc
*/
mosq_EXPORT void *mosquitto_malloc(size_t size);

/*
* Function: mosquitto_realloc
*/
mosq_EXPORT void *mosquitto_realloc(void *ptr, size_t size);

/*
* Function: mosquitto_strdup
*/
mosq_EXPORT char *mosquitto_strdup(const char *s);

/* =========================================================================
*
* Utility Functions
* Section: Utility Functions
*
* Use these functions from within your plugin.
*
Expand All @@ -221,13 +295,13 @@ mosq_EXPORT char *mosquitto_strdup(const char *s);
* Parameters:
* level - Log message priority. Can currently be one of:
*
* MOSQ_LOG_INFO
* MOSQ_LOG_NOTICE
* MOSQ_LOG_WARNING
* MOSQ_LOG_ERR
* MOSQ_LOG_DEBUG
* MOSQ_LOG_SUBSCRIBE (not recommended for use by plugins)
* MOSQ_LOG_UNSUBSCRIBE (not recommended for use by plugins)
* * MOSQ_LOG_INFO
* * MOSQ_LOG_NOTICE
* * MOSQ_LOG_WARNING
* * MOSQ_LOG_ERR
* * MOSQ_LOG_DEBUG
* * MOSQ_LOG_SUBSCRIBE (not recommended for use by plugins)
* * MOSQ_LOG_UNSUBSCRIBE (not recommended for use by plugins)
*
* These values are defined in mosquitto.h.
*
Expand Down Expand Up @@ -309,9 +383,10 @@ mosq_EXPORT int mosquitto_client_protocol(const struct mosquitto *client);
*
* Retrieve the MQTT protocol version with which the client has connected. Can be one of:
*
* 3 - for MQTT v3 / v3.1
* 4 - for MQTT v3.1.1
* 5 - for MQTT v5
* Returns:
* 3 - for MQTT v3 / v3.1
* 4 - for MQTT v3.1.1
* 5 - for MQTT v5
*/
mosq_EXPORT int mosquitto_client_protocol_version(const struct mosquitto *client);

Expand Down Expand Up @@ -354,7 +429,7 @@ mosq_EXPORT int mosquitto_set_username(struct mosquitto *client, const char *use

/* =========================================================================
*
* Client control
* Section: Client control
*
* ========================================================================= */

Expand Down Expand Up @@ -388,7 +463,7 @@ mosq_EXPORT int mosquitto_kick_client_by_username(const char *username, bool wit

/* =========================================================================
*
* Publishing functions
* Section: Publishing functions
*
* ========================================================================= */

Expand Down
Loading

0 comments on commit 7fc4722

Please sign in to comment.