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:
parent
229b1f752f
commit
ec54bce037
@ -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
|
||||
==================
|
||||
|
||||
|
@ -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++;
|
||||
|
Loading…
Reference in New Issue
Block a user