Pass properties when disconnecting clients.

pull/1072/head
Roger Light 7 years ago committed by Roger A. Light
parent 47129e395e
commit 236e967161

@ -37,6 +37,7 @@ set(C_SRC
connect.c
handle_auth.c
handle_connack.c
handle_disconnect.c
handle_ping.c
handle_pubackcomp.c
handle_publish.c

@ -234,7 +234,7 @@ int mosquitto_disconnect_with_properties(struct mosquitto *mosq, int reason_code
}
void do_client_disconnect(struct mosquitto *mosq, int reason_code)
void do_client_disconnect(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties)
{
pthread_mutex_lock(&mosq->state_mutex);
mosq->state = mosq_cs_disconnecting;
@ -265,7 +265,7 @@ void do_client_disconnect(struct mosquitto *mosq, int reason_code)
}
if(mosq->on_disconnect_v5){
mosq->in_callback = true;
mosq->on_disconnect_v5(mosq, mosq->userdata, reason_code, NULL);
mosq->on_disconnect_v5(mosq, mosq->userdata, reason_code, properties);
mosq->in_callback = false;
}
pthread_mutex_unlock(&mosq->callback_mutex);

@ -296,7 +296,7 @@ struct mosquitto {
#define STREMPTY(str) (str[0] == '\0')
void do_client_disconnect(struct mosquitto *mosq, int reason_code);
void do_client_disconnect(struct mosquitto *mosq, int reason_code, const mosquitto_property *properties);
#endif

@ -225,7 +225,7 @@ int packet__write(struct mosquitto *mosq)
}
pthread_mutex_unlock(&mosq->callback_mutex);
}else if(((packet->command)&0xF0) == CMD_DISCONNECT){
do_client_disconnect(mosq, MOSQ_ERR_SUCCESS);
do_client_disconnect(mosq, MOSQ_ERR_SUCCESS, NULL);
packet__cleanup(packet);
mosquitto__free(packet);
return MOSQ_ERR_SUCCESS;

Loading…
Cancel
Save