mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-09 01:01:11 +08:00
Fix unused flags in CONNECT command being forced to be 0 in MQTT v3.1
This check is not required until v3.1.1. Closes #2522. Thanks to garinocyr
This commit is contained in:
parent
b6b8039914
commit
09ac578459
@ -7,6 +7,8 @@ Broker:
|
||||
- Fix bridge `restart_timeout` not being honoured.
|
||||
- Fix potential memory leaks if a plugin modifies the message in the
|
||||
MOSQ_EVT_MESSAGE event.
|
||||
- Fix unused flags in CONNECT command being forced to be 0, which is not
|
||||
required for MQTT v3.1. Closes #2522.
|
||||
|
||||
Client library:
|
||||
- Fix threads library detection on Windows under cmake. Bumps the minimum
|
||||
|
@ -458,9 +458,6 @@ int handle__connect(struct mosquitto *context)
|
||||
rc = MOSQ_ERR_PROTOCOL;
|
||||
goto handle_connect_error;
|
||||
}
|
||||
if(context->in_packet.command != CMD_CONNECT){
|
||||
return MOSQ_ERR_MALFORMED_PACKET;
|
||||
}
|
||||
|
||||
/* Read protocol name as length then bytes rather than with read_string
|
||||
* because the length is fixed and we can check that. Removes the need
|
||||
@ -528,6 +525,9 @@ int handle__connect(struct mosquitto *context)
|
||||
rc = MOSQ_ERR_PROTOCOL;
|
||||
goto handle_connect_error;
|
||||
}
|
||||
if((protocol_version&0x7F) != PROTOCOL_VERSION_v31 && context->in_packet.command != CMD_CONNECT){
|
||||
return MOSQ_ERR_MALFORMED_PACKET;
|
||||
}
|
||||
|
||||
if(packet__read_byte(&context->in_packet, &connect_flags)){
|
||||
rc = MOSQ_ERR_PROTOCOL;
|
||||
|
@ -3,6 +3,14 @@
|
||||
"comment": "CONNECT TESTS ARE INCOMPLETE",
|
||||
"group": "v3.1 CONNECT",
|
||||
"tests": [
|
||||
{ "name": "10 ok ", "connect":false, "expect_disconnect":false, "msgs":[
|
||||
{"type":"send", "payload":"10 0F 0006 4D5149736470 03 01 000A 0001 70", "comment":"minimal valid CONNECT"},
|
||||
{"type":"recv", "payload":"20 02 00 00", "comment": "CONNACK"}
|
||||
]},
|
||||
{ "name": "14 ok ", "connect":false, "expect_disconnect":false, "msgs":[
|
||||
{"type":"send", "payload":"14 0F 0006 4D5149736470 03 01 000A 0001 70", "comment":"CONNECT with QoS=1"},
|
||||
{"type":"recv", "payload":"20 02 00 00", "comment": "CONNACK"}
|
||||
]},
|
||||
{ "name": "10 proto ver 2", "connect":false, "msgs":[
|
||||
{"type":"send", "payload":"10 0F 0006 4D5149736470 02 00 000A 0001 70", "comment":"CONNECT"},
|
||||
{"type":"recv", "payload":"20 02 00 01", "comment": "CONNACK identifier rejected"}
|
||||
|
Loading…
x
Reference in New Issue
Block a user