diff --git a/ChangeLog.txt b/ChangeLog.txt index 412cfcef..9ea60815 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -14,10 +14,14 @@ Broker: - Print OpenSSL errors in more situations, like when loading certificates fails. Closes #1552. -Library: +Client library: - Set minimum keepalive argument to `mosquitto_connect*()` to be 5 seconds. Closes #1550. +Clients: +- Fix `--remove-retained` not obeying the `-T` option for filtering out + topics. Closes #1585. + 1.6.8 - 20191128 ================ diff --git a/client/sub_client.c b/client/sub_client.c index 8894ca05..ca471a23 100644 --- a/client/sub_client.c +++ b/client/sub_client.c @@ -76,10 +76,6 @@ void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquit if(process_messages == false) return; - if(cfg.remove_retained && message->retain){ - mosquitto_publish(mosq, &last_mid, message->topic, 0, NULL, 1, true); - } - if(cfg.retained_only && !message->retain && process_messages){ process_messages = false; if(last_mid == 0){ @@ -96,6 +92,10 @@ void my_message_callback(struct mosquitto *mosq, void *obj, const struct mosquit } } + if(cfg.remove_retained && message->retain){ + mosquitto_publish(mosq, &last_mid, message->topic, 0, NULL, 1, true); + } + print_message(&cfg, message); if(cfg.msg_count>0){