mosquitto_loop_forever now quits after a fatal error, rather than blindly retrying.

pull/211/merge
Roger A. Light 11 years ago
parent 950c4ed9c6
commit e9c18f8347

@ -47,6 +47,10 @@ Clients:
- Both clients can now load default configuration options from a file.
- Add -1 (oneshot) option to mosquitto_sub.
Client library:
- mosquitto_loop_forever now quits after a fatal error, rather than blindly
retrying.
1.3.2 - 2014xxxx
================

@ -937,6 +937,22 @@ int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets)
reconnects = 0;
}
}while(run && rc == MOSQ_ERR_SUCCESS);
/* Quit after fatal errors. */
switch(rc){
case MOSQ_ERR_NOMEM:
case MOSQ_ERR_PROTOCOL:
case MOSQ_ERR_INVAL:
case MOSQ_ERR_NOT_FOUND:
case MOSQ_ERR_TLS:
case MOSQ_ERR_PAYLOAD_SIZE:
case MOSQ_ERR_NOT_SUPPORTED:
case MOSQ_ERR_AUTH:
case MOSQ_ERR_ACL_DENIED:
case MOSQ_ERR_UNKNOWN:
case MOSQ_ERR_ERRNO:
case MOSQ_ERR_EAI:
return rc;
}
if(errno == EPROTO){
return rc;
}

Loading…
Cancel
Save