diff --git a/ChangeLog.txt b/ChangeLog.txt index a83ba2fd2a..9fc569540f 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -8,6 +8,7 @@ Broker features: - Add support for Automotive DLT logging. - Add TLS Engine support. - Persistence file read/write performance improvements. +- General performance improvements. - Add max_keepalive option, to allow a maximum keepalive value to be set for MQTT v5 clients only. - Add `bind_interface` option which allows a listener to be bound to a @@ -53,8 +54,12 @@ Client features: - Drop support for TLS v1.0. Broker fixes: +- Improve error reporting when creating listeners. - Fix build on SmartOS due to missing IPV6_V6ONLY. Closes #1212. +Client library fixes +- Add missing `mosquitto_userdata()` function. + Client fixes: - mosquitto_pub wouldn't always publish all messages when using `-l` and QoS>0. This has been fixed. diff --git a/lib/options.c b/lib/options.c index 72fb8aaea8..005b781018 100644 --- a/lib/options.c +++ b/lib/options.c @@ -471,3 +471,7 @@ void mosquitto_user_data_set(struct mosquitto *mosq, void *userdata) } } +void *mosquitto_userdata(struct mosquitto *mosq) +{ + return mosq->userdata; +} diff --git a/src/net.c b/src/net.c index 7b6793cb84..c0911ad9f1 100644 --- a/src/net.c +++ b/src/net.c @@ -439,7 +439,11 @@ int net__socket_listen(struct mosquitto__listener *listener) hints.ai_flags = AI_PASSIVE; hints.ai_socktype = SOCK_STREAM; - if(getaddrinfo(listener->host, service, &hints, &ainfo)) return INVALID_SOCKET; + rc = getaddrinfo(listener->host, service, &hints, &ainfo); + if (rc){ + log__printf(NULL, MOSQ_LOG_ERR, "Error creating listener: %s.", gai_strerror(rc)); + return INVALID_SOCKET; + } listener->sock_count = 0; listener->socks = NULL;