mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-30 02:37:31 +02:00
Merge pull request #833 from david-cermak/fix/mosq_minor
[mosq]: Fix some recent bugs
This commit is contained in:
2
.github/workflows/mosq__build.yml
vendored
2
.github/workflows/mosq__build.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
name: Mosquitto build
|
name: Mosquitto build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
idf_ver: ["latest", "release-v5.3"]
|
idf_ver: ["latest", "release-v5.5", "release-v5.4", "release-v5.3", "release-v5.2", "release-v5.1"]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
container: espressif/idf:${{ matrix.idf_ver }}
|
container: espressif/idf:${{ matrix.idf_ver }}
|
||||||
env:
|
env:
|
||||||
|
@ -3,6 +3,6 @@ commitizen:
|
|||||||
bump_message: 'bump(mosq): $current_version -> $new_version'
|
bump_message: 'bump(mosq): $current_version -> $new_version'
|
||||||
pre_bump_hooks: python ../../ci/changelog.py mosquitto
|
pre_bump_hooks: python ../../ci/changelog.py mosquitto
|
||||||
tag_format: mosq-v$version
|
tag_format: mosq-v$version
|
||||||
version: 2.0.20~2
|
version: 2.0.20~3
|
||||||
version_files:
|
version_files:
|
||||||
- idf_component.yml
|
- idf_component.yml
|
||||||
|
@ -1,5 +1,15 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.0.20~3](https://github.com/espressif/esp-protocols/commits/mosq-v2.0.20_3)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- Support build on older IDF branches ([13b90ad1](https://github.com/espressif/esp-protocols/commit/13b90ad1))
|
||||||
|
- Fix misleading error when accepting connection ([fd410061](https://github.com/espressif/esp-protocols/commit/fd410061), [#807](https://github.com/espressif/esp-protocols/issues/807))
|
||||||
|
- Make mosquitto component c++ compatible ([c4169765](https://github.com/espressif/esp-protocols/commit/c4169765), [#817](https://github.com/espressif/esp-protocols/issues/817))
|
||||||
|
- include config.h before any system header ([1b1ede43](https://github.com/espressif/esp-protocols/commit/1b1ede43))
|
||||||
|
|
||||||
## [2.0.20~2](https://github.com/espressif/esp-protocols/commits/mosq-v2.0.20_2)
|
## [2.0.20~2](https://github.com/espressif/esp-protocols/commits/mosq-v2.0.20_2)
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
@ -1,5 +1,13 @@
|
|||||||
menu "Mosquitto"
|
menu "Mosquitto"
|
||||||
|
|
||||||
|
config MOSQ_IS_ENABLED
|
||||||
|
# Invisible option that is enabled if MOSQ is added to the IDF components.
|
||||||
|
# This is used to "select" CONFIG_ESP_TLS_SERVER option (needed for TLS connection)
|
||||||
|
# (these are optionally used in mosq)
|
||||||
|
bool
|
||||||
|
default "y"
|
||||||
|
select ESP_TLS_SERVER
|
||||||
|
|
||||||
config MOSQ_ENABLE_SYS
|
config MOSQ_ENABLE_SYS
|
||||||
bool "Enable $SYS topics"
|
bool "Enable $SYS topics"
|
||||||
default n
|
default n
|
||||||
|
@ -37,7 +37,7 @@ Variables:
|
|||||||
|
|
||||||
- void(\* handle_message_cb <br>On message callback. If configured, user function is called whenever mosquitto processes a message.
|
- void(\* handle_message_cb <br>On message callback. If configured, user function is called whenever mosquitto processes a message.
|
||||||
|
|
||||||
- char \* host <br>Address on which the broker is listening for connections
|
- const char \* host <br>Address on which the broker is listening for connections
|
||||||
|
|
||||||
- int port <br>Port number of the broker to listen to
|
- int port <br>Port number of the broker to listen to
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||||
*/
|
*/
|
||||||
|
#include "freertos/FreeRTOS.h"
|
||||||
|
#include "freertos/event_groups.h"
|
||||||
#include "nvs_flash.h"
|
#include "nvs_flash.h"
|
||||||
#include "esp_event.h"
|
#include "esp_event.h"
|
||||||
#include "esp_netif.h"
|
#include "esp_netif.h"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
version: "2.0.20~2"
|
version: "2.0.20~3"
|
||||||
url: https://github.com/espressif/esp-protocols/tree/master/components/mosquitto
|
url: https://github.com/espressif/esp-protocols/tree/master/components/mosquitto
|
||||||
description: The component provides a simple ESP32 port of mosquitto broker
|
description: The component provides a simple ESP32 port of mosquitto broker
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
@ -7,6 +7,10 @@
|
|||||||
#include "mosquitto.h"
|
#include "mosquitto.h"
|
||||||
#include "esp_tls.h"
|
#include "esp_tls.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
struct mosquitto__config;
|
struct mosquitto__config;
|
||||||
|
|
||||||
typedef void (*mosq_message_cb_t)(char *client, char *topic, char *data, int len, int qos, int retain);
|
typedef void (*mosq_message_cb_t)(char *client, char *topic, char *data, int len, int qos, int retain);
|
||||||
@ -17,7 +21,7 @@ typedef void (*mosq_message_cb_t)(char *client, char *topic, char *data, int len
|
|||||||
* structure.
|
* structure.
|
||||||
*/
|
*/
|
||||||
struct mosq_broker_config {
|
struct mosq_broker_config {
|
||||||
char *host; /*!< Address on which the broker is listening for connections */
|
const char *host; /*!< Address on which the broker is listening for connections */
|
||||||
int port; /*!< Port number of the broker to listen to */
|
int port; /*!< Port number of the broker to listen to */
|
||||||
esp_tls_cfg_server_t *tls_cfg; /*!< ESP-TLS configuration (if TLS transport used)
|
esp_tls_cfg_server_t *tls_cfg; /*!< ESP-TLS configuration (if TLS transport used)
|
||||||
* Please refer to the ESP-TLS official documentation
|
* Please refer to the ESP-TLS official documentation
|
||||||
@ -48,3 +52,7 @@ int mosq_broker_run(struct mosq_broker_config *config);
|
|||||||
* @note After calling this API, function mosq_broker_run() unblocks and returns.
|
* @note After calling this API, function mosq_broker_run() unblocks and returns.
|
||||||
*/
|
*/
|
||||||
void mosq_broker_stop(void);
|
void mosq_broker_stop(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
||||||
*
|
*
|
||||||
* SPDX-FileContributor: 2024 Espressif Systems (Shanghai) CO LTD
|
* SPDX-FileContributor: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -106,6 +106,9 @@ struct mosquitto *net__socket_accept(struct mosquitto__listener_sock *listensock
|
|||||||
|
|
||||||
new_sock = accept(listensock->sock, NULL, 0);
|
new_sock = accept(listensock->sock, NULL, 0);
|
||||||
if (new_sock == INVALID_SOCKET) {
|
if (new_sock == INVALID_SOCKET) {
|
||||||
|
if (errno == EAGAIN) { // mosquitto tries to accept() in a loop until EAGAIN is returned
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
log__printf(NULL, MOSQ_LOG_ERR,
|
log__printf(NULL, MOSQ_LOG_ERR,
|
||||||
"Unable to accept new connection, system socket count has been exceeded. Try increasing \"ulimit -n\" or equivalent.");
|
"Unable to accept new connection, system socket count has been exceeded. Try increasing \"ulimit -n\" or equivalent.");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -20,4 +20,4 @@
|
|||||||
#undef isspace
|
#undef isspace
|
||||||
#define isspace(__c) (__ctype_lookup((int)__c)&_S)
|
#define isspace(__c) (__ctype_lookup((int)__c)&_S)
|
||||||
|
|
||||||
#define VERSION "v2.0.20~2"
|
#define VERSION "v2.0.20~3"
|
||||||
|
Reference in New Issue
Block a user