From f21ccc362b4a439368c82ed633c9f71d2d81a3cd Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Tue, 30 Jul 2019 18:46:52 +0100 Subject: [PATCH] Fix mosquitto_string_option(, MOSQ_OPT_TLS_KEYFORM, ) return value `mosquitto_string_option(mosq, MOSQ_OPT_TLS_KEYFORM, ...)` was incorrectly returning `MOSQ_ERR_INVAL` with valid input. This has been fixed. Closes #1360. Thanks to Michael Dombrowski. --- ChangeLog.txt | 3 +++ lib/options.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 3c4898a13e..6aa8109793 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -13,6 +13,9 @@ Client library: - Make behaviour of `mosquitto_connect_async()` consistent with `mosquitto_connect()` when connecting to a non-existent server. Closes #1345. +- `mosquitto_string_option(mosq, MOSQ_OPT_TLS_KEYFORM, ...)` was incorrectly + returning `MOSQ_ERR_INVAL` with valid input. This has been fixed. + Closes #1360. Clients: - mosquitto_pub: fix error codes not being returned when mosquitto_pub exits. diff --git a/lib/options.c b/lib/options.c index 7bab736628..483edbb2d5 100644 --- a/lib/options.c +++ b/lib/options.c @@ -289,6 +289,7 @@ int mosquitto_string_option(struct mosquitto *mosq, enum mosq_opt_t option, cons }else{ return MOSQ_ERR_INVAL; } + return MOSQ_ERR_SUCCESS; #else return MOSQ_ERR_NOT_SUPPORTED; #endif @@ -322,8 +323,6 @@ int mosquitto_string_option(struct mosquitto *mosq, enum mosq_opt_t option, cons default: return MOSQ_ERR_INVAL; } - - return MOSQ_ERR_INVAL; }