Don't busy loop with `mosquitto_pub -l` on a slow connection.

pull/1794/head
Roger A. Light 5 years ago
parent 9929ce0a26
commit a224a8f217

@ -1,5 +1,6 @@
Clients:
- All clients exit with an error exit code on CONNACK failure. Closes #1778.
- Don't busy loop with `mosquitto_pub -l` on a slow connection.
1.6.11 - 2020-08-11

@ -235,6 +235,17 @@ int pub_stdin_line_loop(struct mosquitto *mosq)
mosquitto_loop_start(mosq);
stdin_finished = false;
do{
if(status == STATUS_CONNECTING){
#ifdef WIN32
Sleep(100);
#else
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 100000000;
nanosleep(&ts, NULL);
#endif
}
if(status == STATUS_CONNACK_RECVD){
pos = 0;
read_len = line_buf_len;

Loading…
Cancel
Save