From 7ae22c356be5c567503357917fca818c4d076c5a Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 13 Sep 2023 09:02:55 +0100 Subject: [PATCH] Fix mosquitto_rr not honouring `-R`. Closes #2893. Thanks to jwinder-ca --- ChangeLog.txt | 3 +++ client/rr_client.c | 31 ++++--------------------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 67679137..f75338e2 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -5,6 +5,9 @@ Broker: - Fix crash on subscribe under certain unlikely conditions. Closes #2885. Closes #2881. +Clients: +- Fix mosquitto_rr not honouring `-R`. Closes #2893. + 2.0.17 - 2023-08-22 =================== diff --git a/client/rr_client.c b/client/rr_client.c index e74536f7..eb98b7f8 100644 --- a/client/rr_client.c +++ b/client/rr_client.c @@ -84,7 +84,11 @@ static void my_message_callback(struct mosquitto *mosq, void *obj, const struct UNUSED(obj); UNUSED(properties); + if(process_messages == false) return; + if(message->retain && cfg.no_retain) return; + print_message(&cfg, message, properties); + switch(cfg.pub_mode){ case MSGMODE_CMD: case MSGMODE_FILE: @@ -96,33 +100,6 @@ static void my_message_callback(struct mosquitto *mosq, void *obj, const struct client_state = rr_s_ready_to_publish; break; } - /* FIXME - check all below - if(process_messages == false) return; - - if(cfg.retained_only && !message->retain && process_messages){ - process_messages = false; - mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); - return; - } - - if(message->retain && cfg.no_retain) return; - if(cfg.filter_outs){ - for(i=0; itopic, &res); - if(res) return; - } - } - - //print_message(&cfg, message); - - if(cfg.msg_count>0){ - msg_count++; - if(cfg.msg_count == msg_count){ - process_messages = false; - mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); - } - } - */ } void my_connect_callback(struct mosquitto *mosq, void *obj, int result, int flags, const mosquitto_property *properties)