Report error string on connection failure rather than error code.

pull/211/merge
Roger A. Light 10 years ago
parent 2a880cf5b3
commit c1974e5402

@ -1,6 +1,13 @@
Broker:
- Fix incorrect bridge notification on initial connection. Closes #467096.
- Build fixes for OpenBSD.
Client library:
- Add missing error strings to mosquitto_strerror.
Clients:
- Report error string on connection failure rather than error code.
1.4.2 - 20150507
================

@ -755,7 +755,7 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)
#endif
fprintf(stderr, "Error: %s\n", err);
}else{
fprintf(stderr, "Unable to connect (%d).\n", rc);
fprintf(stderr, "Unable to connect (%s).\n", mosquitto_strerror(rc));
}
}
mosquitto_lib_cleanup();

@ -1273,6 +1273,8 @@ void mosquitto_user_data_set(struct mosquitto *mosq, void *userdata)
const char *mosquitto_strerror(int mosq_errno)
{
switch(mosq_errno){
case MOSQ_ERR_CONN_PENDING:
return "Connection pending.";
case MOSQ_ERR_SUCCESS:
return "No error.";
case MOSQ_ERR_NOMEM:
@ -1303,6 +1305,8 @@ const char *mosquitto_strerror(int mosq_errno)
return "Unknown error.";
case MOSQ_ERR_ERRNO:
return strerror(errno);
case MOSQ_ERR_EAI:
return "Lookup error.";
case MOSQ_ERR_PROXY:
return "Proxy error.";
default:

Loading…
Cancel
Save