diff --git a/ChangeLog.txt b/ChangeLog.txt index dbf44168..92b2c79d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -9,6 +9,10 @@ Broker: listening socket, by calling freeaddrinfo. Closes #1565. - Fix config->user not being freed on exit. Closes #1564. +Library: +- Set minimum keepalive argument to `mosquitto_connect*()` to be 5 seconds. + Closes #1550. + 1.6.8 - 20191128 ================ diff --git a/lib/connect.c b/lib/connect.c index fd5c4979..bf847430 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -43,6 +43,7 @@ static int mosquitto__connect_init(struct mosquitto *mosq, const char *host, int if(!mosq) return MOSQ_ERR_INVAL; if(!host || port <= 0) return MOSQ_ERR_INVAL; + if(keepalive < 5) return MOSQ_ERR_INVAL; if(mosq->id == NULL && (mosq->protocol == mosq_p_mqtt31 || mosq->protocol == mosq_p_mqtt311)){ mosq->id = (char *)mosquitto__calloc(24, sizeof(char));