Fix default port problem when compiling clients using WITH_TLS=no.
This commit is contained in:
parent
ab5af8f0b9
commit
3d3b7fc46f
@ -32,6 +32,10 @@ Library:
|
|||||||
- Fix connection problems when mosquitto_loop_start() was called before
|
- Fix connection problems when mosquitto_loop_start() was called before
|
||||||
mosquitto_connect_async(). Closes #848.
|
mosquitto_connect_async(). Closes #848.
|
||||||
|
|
||||||
|
Clients:
|
||||||
|
- When compiled using WITH_TLS=no, the default port was incorrectly being set
|
||||||
|
to -1. This has been fixed.
|
||||||
|
|
||||||
Build:
|
Build:
|
||||||
- Fixes for building on NetBSD. Closes #258.
|
- Fixes for building on NetBSD. Closes #258.
|
||||||
|
|
||||||
|
@ -978,20 +978,20 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg)
|
|||||||
int rc;
|
int rc;
|
||||||
int port;
|
int port;
|
||||||
|
|
||||||
#ifdef WITH_TLS
|
|
||||||
if(cfg->port < 0){
|
if(cfg->port < 0){
|
||||||
|
#ifdef WITH_TLS
|
||||||
if(cfg->cafile || cfg->capath
|
if(cfg->cafile || cfg->capath
|
||||||
#ifdef WITH_TLS_PSK
|
# ifdef WITH_TLS_PSK
|
||||||
|| cfg->psk
|
|| cfg->psk
|
||||||
#endif
|
# endif
|
||||||
){
|
){
|
||||||
port = 8883;
|
port = 8883;
|
||||||
}else{
|
}else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
port = 1883;
|
port = 1883;
|
||||||
}
|
}
|
||||||
}else
|
}else{
|
||||||
#endif
|
|
||||||
{
|
|
||||||
port = cfg->port;
|
port = cfg->port;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user