"retained" -> "want_retained".

pull/139/head
Roger A. Light 10 years ago
parent 7709621911
commit 4e4c08aaf0

@ -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,

@ -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,

@ -375,7 +375,7 @@
<funcsynopsis><funcprototype><funcdef>int <function>mosquitto_subscribe_simple</function></funcdef>
<paramdef>struct mosquitto_message **<parameter>message</parameter></paramdef>
<paramdef>int <parameter>msg_count</parameter></paramdef>
<paramdef>bool <parameter>retained</parameter></paramdef>
<paramdef>bool <parameter>want_retained</parameter></paramdef>
<paramdef>const char *<parameter>topic</parameter></paramdef>
<paramdef>int<parameter>qos</parameter></paramdef>
<paramdef>const char *<parameter>host</parameter></paramdef>

Loading…
Cancel
Save