Skip to content

Commit

Permalink
Fix mosquitto_rr not honouring -R.
Browse files Browse the repository at this point in the history
Closes #2893. Thanks to jwinder-ca
  • Loading branch information
ralight committed Sep 13, 2023
1 parent 66c6276 commit 7ae22c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.txt
Expand Up @@ -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
===================
Expand Down
31 changes: 4 additions & 27 deletions client/rr_client.c
Expand Up @@ -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:
Expand All @@ -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; i<cfg.filter_out_count; i++){
mosquitto_topic_matches_sub(cfg.filter_outs[i], message->topic, &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)
Expand Down

0 comments on commit 7ae22c3

Please sign in to comment.