Fixes for clients that disconnect very quickly.
This commit is contained in:
parent
fd9496433c
commit
1257fd49eb
@ -936,7 +936,7 @@ int mosquitto_loop_forever(struct mosquitto *mosq, int timeout, int max_packets)
|
|||||||
if (reconnects !=0 && rc == MOSQ_ERR_SUCCESS){
|
if (reconnects !=0 && rc == MOSQ_ERR_SUCCESS){
|
||||||
reconnects = 0;
|
reconnects = 0;
|
||||||
}
|
}
|
||||||
}while(rc == MOSQ_ERR_SUCCESS);
|
}while(run && rc == MOSQ_ERR_SUCCESS);
|
||||||
if(errno == EPROTO){
|
if(errno == EPROTO){
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,9 @@ int _mosquitto_handle_connack(struct mosquitto *mosq)
|
|||||||
pthread_mutex_unlock(&mosq->callback_mutex);
|
pthread_mutex_unlock(&mosq->callback_mutex);
|
||||||
switch(result){
|
switch(result){
|
||||||
case 0:
|
case 0:
|
||||||
mosq->state = mosq_cs_connected;
|
if(mosq->state != mosq_cs_disconnecting){
|
||||||
|
mosq->state = mosq_cs_connected;
|
||||||
|
}
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
|
Loading…
Reference in New Issue
Block a user