Protocol name will never be changed from MQTT.

pull/1022/head
Roger A. Light 7 years ago
parent 5dc88fe8f3
commit 99c6ec7f6e

@ -22,10 +22,9 @@ Contributors:
#define PROTOCOL_NAME_v31 "MQIsdp"
#define PROTOCOL_VERSION_v31 3
#define PROTOCOL_NAME_v311 "MQTT"
#define PROTOCOL_VERSION_v311 4
#define PROTOCOL_NAME "MQTT"
#define PROTOCOL_NAME_v5 "MQTT"
#define PROTOCOL_VERSION_v311 4
#define PROTOCOL_VERSION_v5 5

@ -99,7 +99,7 @@ int send__connect(struct mosquitto *mosq, uint16_t keepalive, bool clean_session
if(version == MQTT_PROTOCOL_V31){
packet__write_string(packet, PROTOCOL_NAME_v31, strlen(PROTOCOL_NAME_v31));
}else if(version == MQTT_PROTOCOL_V311){
packet__write_string(packet, PROTOCOL_NAME_v311, strlen(PROTOCOL_NAME_v311));
packet__write_string(packet, PROTOCOL_NAME, strlen(PROTOCOL_NAME));
}
#if defined(WITH_BROKER) && defined(WITH_BRIDGE)
if(mosq->bridge && mosq->bridge->try_private && mosq->bridge->try_private_accepted){

@ -182,7 +182,7 @@ int handle__connect(struct mosquitto_db *db, struct mosquitto *context)
goto handle_connect_error;
}
context->protocol = mosq_p_mqtt31;
}else if(!strcmp(protocol_name, PROTOCOL_NAME_v311)){
}else if(!strcmp(protocol_name, PROTOCOL_NAME)){
if((protocol_version&0x7F) != PROTOCOL_VERSION_v311){
if(db->config->connection_messages == true){
log__printf(NULL, MOSQ_LOG_INFO, "Invalid protocol version %d in CONNECT from %s.",

Loading…
Cancel
Save