From 95e009c42968fea74dc1de0f4fbe1e4012b8bc31 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sat, 24 Oct 2020 00:17:13 +0100 Subject: [PATCH] Document what to do on non-matching plugin versions. --- include/mosquitto_plugin.h | 3 +++ src/security.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/mosquitto_plugin.h b/include/mosquitto_plugin.h index 31af29ad..a2ee194b 100644 --- a/include/mosquitto_plugin.h +++ b/include/mosquitto_plugin.h @@ -123,6 +123,9 @@ struct mosquitto_acl_msg { * return the plugin interface version you support, i.e. 5. * * The supported_versions array tells you which plugin versions the broker supports. + * + * If the broker does not support the version that you require, return -1 to + * indicate failure. */ int mosquitto_plugin_version(int supported_version_count, const int *supported_versions); diff --git a/src/security.c b/src/security.c index 0cc09077..d39353ad 100644 --- a/src/security.c +++ b/src/security.c @@ -370,8 +370,8 @@ static int security__module_init_single(struct mosquitto__listener *listener, st } }else{ log__printf(NULL, MOSQ_LOG_ERR, - "Error: Incorrect auth plugin version (got %d, expected %d).", - version, MOSQ_AUTH_PLUGIN_VERSION); + "Error: Unsupported auth plugin version (got %d, expected %d).", + version, MOSQ_PLUGIN_VERSION); LIB_ERROR(); LIB_CLOSE(lib);