From 946003737c663409f2a54139ebca306c20dcd475 Mon Sep 17 00:00:00 2001 From: Ery Lee Date: Wed, 14 Jan 2015 13:05:09 +0800 Subject: [PATCH] fix clietid validator --- apps/emqtt/src/emqtt_protocol.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqtt/src/emqtt_protocol.erl b/apps/emqtt/src/emqtt_protocol.erl index 0e2a22354..451a73c27 100644 --- a/apps/emqtt/src/emqtt_protocol.erl +++ b/apps/emqtt/src/emqtt_protocol.erl @@ -349,7 +349,7 @@ validate_protocol(#mqtt_packet_connect { proto_ver = Ver, proto_name = Name }) - lists:member({Ver, Name}, ?PROTOCOL_NAMES). validate_clientid(#mqtt_packet_connect { client_id = ClientId }) - when ( size(ClientId) >= 1 ) andalso ( size(ClientId) >= ?MAX_CLIENTID_LEN ) -> + when ( size(ClientId) >= 1 ) andalso ( size(ClientId) > ?MAX_CLIENTID_LEN ) -> true; %% MQTT3.1.1 allow null clientId.