Update for 1.6.6
parent
8cfb3856c9
commit
0c64f4406f
@ -1,32 +0,0 @@
|
||||
Description: Fix for v5 DISCONNECT packets with remaining length=2
|
||||
Author: Roger Light <roger@atchoo.org>
|
||||
Forwarded: not-needed
|
||||
--- a/src/handle_disconnect.c
|
||||
+++ b/src/handle_disconnect.c
|
||||
@@ -34,12 +34,12 @@ int handle__disconnect(struct mosquitto_db *db, struct mosquitto *context)
|
||||
return MOSQ_ERR_INVAL;
|
||||
}
|
||||
|
||||
- if(context->protocol == mosq_p_mqtt5 && context->in_packet.remaining_length > 1){
|
||||
+ if(context->protocol == mosq_p_mqtt5 && context->in_packet.remaining_length > 0){
|
||||
/* FIXME - must handle reason code */
|
||||
rc = packet__read_byte(&context->in_packet, &reason_code);
|
||||
if(rc) return rc;
|
||||
|
||||
- if(context->in_packet.remaining_length > 2){
|
||||
+ if(context->in_packet.remaining_length > 1){
|
||||
rc = property__read_all(CMD_DISCONNECT, &context->in_packet, &properties);
|
||||
if(rc) return rc;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ int handle__disconnect(struct mosquitto_db *db, struct mosquitto *context)
|
||||
}
|
||||
mosquitto_property_free_all(&properties); /* FIXME - TEMPORARY UNTIL PROPERTIES PROCESSED */
|
||||
|
||||
- if(context->in_packet.remaining_length != 0){
|
||||
+ if(context->in_packet.pos != context->in_packet.remaining_length){
|
||||
return MOSQ_ERR_PROTOCOL;
|
||||
}
|
||||
log__printf(NULL, MOSQ_LOG_DEBUG, "Received DISCONNECT from %s", context->id);
|
||||
--
|
||||
2.17.1
|
||||
|
Loading…
Reference in New Issue