Fix mosquitto_sub pipe close detection.

If sending mosquitto_sub output to a pipe, mosquitto_sub will now detect
that the pipe has closed and disconnect.

Closes #2164. Thanks to Frantisek Fuka.
This commit is contained in:
Roger A. Light 2021-04-06 23:01:48 +01:00
parent 229b1f752f
commit ec54bce037
2 changed files with 11 additions and 0 deletions

View File

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

View File

@ -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++;