diff --git a/ChangeLog.txt b/ChangeLog.txt index bf9b09fd..add80098 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +2.0.11 - 2021-xx-xx +=================== + +Clients: +- If sending mosquitto_sub output to a pipe, mosquitto_sub will now detect + that the pipe has closed and disconnect. Closes #2164. + + 2.0.10 - 2021-04-03 ================== diff --git a/client/sub_client.c b/client/sub_client.c index 72170ab2..5e5e570c 100644 --- a/client/sub_client.c +++ b/client/sub_client.c @@ -96,6 +96,9 @@ static void my_message_callback(struct mosquitto *mosq, void *obj, const struct } print_message(&cfg, message, properties); + if(ferror(stdout)){ + mosquitto_disconnect_v5(mosq, 0, cfg.disconnect_props); + } if(cfg.msg_count>0){ msg_count++;