diff options
author | V.Krishn <vkrishn4@gmail.com> | 2018-09-05 11:47:34 +0530 |
---|---|---|
committer | V.Krishn <vkrishn4@gmail.com> | 2018-09-05 11:47:34 +0530 |
commit | ef1a79b93c2bb99e45238cf63343793953656cb5 (patch) | |
tree | 69ac5b3d61298767d58820cc2001d41aa8f5f70b /client_shared.c | |
parent | 0aaee76b698f354a7b90dc316131f5c6c9257dfc (diff) | |
download | mqtt-dirpub-ef1a79b93c2bb99e45238cf63343793953656cb5.tar.bz2 |
update to mosquitto-v1.5.1
Diffstat (limited to 'client_shared.c')
-rw-r--r-- | client_shared.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/client_shared.c b/client_shared.c index b3ab691..ba4ab5f 100644 --- a/client_shared.c +++ b/client_shared.c @@ -16,7 +16,7 @@ Contributors: V Krishn - implement dirpub. */ -#define _POSIX_C_SOURCE 200809L +#include "config.h" #include <errno.h> #include <fcntl.h> @@ -128,8 +128,8 @@ void init_config(struct mosq_config *cfg) cfg->keepalive = 60; cfg->clean_session = true; cfg->eol = true; - cfg->protocol_version = MQTT_PROTOCOL_V31; - + cfg->protocol_version = MQTT_PROTOCOL_V311; + cfg->isfmask = false; cfg->overwrite = false; @@ -189,7 +189,7 @@ void client_config_cleanup(struct mosq_config *cfg) //free(cfg->ffmask); //free(cfg->ftoken); free(cfg->fmask_topic); - + } int client_config_load(struct mosq_config *cfg, int pub_or_sub, int argc, char *argv[]) @@ -1010,20 +1010,20 @@ int client_connect(struct mosquitto *mosq, struct mosq_config *cfg) int rc; int port; -#ifdef WITH_TLS if(cfg->port < 0){ +#ifdef WITH_TLS if(cfg->cafile || cfg->capath -#ifdef WITH_TLS_PSK +# ifdef WITH_TLS_PSK || cfg->psk -#endif +# endif ){ port = 8883; - }else{ + }else +#endif + { port = 1883; } - }else -#endif - { + }else{ port = cfg->port; } |