diff --git a/lib/helpers.c b/lib/helpers.c index 7071ccf2..c2693a5b 100644 --- a/lib/helpers.c +++ b/lib/helpers.c @@ -32,7 +32,7 @@ struct userdata__simple { struct mosquitto_message *messages; int max_msg_count; int message_count; - bool retained; + bool want_retained; }; @@ -64,8 +64,8 @@ static int on_message_simple(struct mosquitto *mosq, void *obj, const struct mos return 0; } - /* Don't process stale retained messages if 'retained' was false */ - if(!userdata->retained && message->retain){ + /* Don't process stale retained messages if 'want_retained' was false */ + if(!userdata->want_retained && message->retain){ return 0; } @@ -86,7 +86,7 @@ static int on_message_simple(struct mosquitto *mosq, void *obj, const struct mos libmosq_EXPORT int mosquitto_subscribe_simple( struct mosquitto_message **messages, int msg_count, - bool retained, + bool want_retained, const char *topic, int qos, const char *host, @@ -115,7 +115,7 @@ libmosq_EXPORT int mosquitto_subscribe_simple( } userdata.message_count = 0; userdata.max_msg_count = msg_count; - userdata.retained = retained; + userdata.want_retained = want_retained; rc = mosquitto_subscribe_callback( on_message_simple, &userdata, diff --git a/lib/mosquitto.h b/lib/mosquitto.h index 1babfedc..014c29e1 100644 --- a/lib/mosquitto.h +++ b/lib/mosquitto.h @@ -1575,11 +1575,11 @@ struct libmosquitto_tls { * messages will be returned here. On error, this will be set to * NULL. * msg_count - the number of messages to retrieve. - * retained - if set to true, stale retained messages will be treated as + * want_retained - if set to true, stale retained messages will be treated as + * normal messages with regards to msg_count. If set to + * false, they will be ignored. * topic - the subscription topic to use (wildcards are allowed). * qos - the qos to use for the subscription. - * normal messages with regards to msg_count. If set to false, - * they will be ignored. * host - the broker to connect to. * port - the network port the broker is listening on. * client_id - the client id to use, or NULL if a random client id should be @@ -1601,7 +1601,7 @@ struct libmosquitto_tls { libmosq_EXPORT int mosquitto_subscribe_simple( struct mosquitto_message **messages, int msg_count, - bool retained, + bool want_retained, const char *topic, int qos, const char *host, diff --git a/man/libmosquitto.3.xml b/man/libmosquitto.3.xml index 70e44cb3..0048ee4a 100644 --- a/man/libmosquitto.3.xml +++ b/man/libmosquitto.3.xml @@ -375,7 +375,7 @@ int mosquitto_subscribe_simple struct mosquitto_message **message int msg_count - bool retained + bool want_retained const char *topic intqos const char *host