@@ -150,23 +150,13 @@ protected void decode(
150
150
//this is the message size HiveMQ allows for incoming messages
151
151
if (packetSize > mqttConfig .maxPacketSize ()) {
152
152
//connack with PACKET_TOO_LARGE for Mqtt5
153
- final ProtocolVersion protocolVersion = connectDecoder .decodeProtocolVersion (clientConnectionContext , buf );
154
- if (protocolVersion == ProtocolVersion .MQTTv5 ) {
155
- mqttConnacker .connackError (clientConnectionContext .getChannel (),
156
- "A client (IP: {}) connect packet exceeded the maximum permissible size." ,
157
- "Sent CONNECT exceeded the maximum permissible size" ,
158
- Mqtt5ConnAckReasonCode .PACKET_TOO_LARGE ,
159
- ReasonStrings .CONNACK_PACKET_TOO_LARGE );
160
- } else { //force channel close for Mqtt3.1 and Mqtt3.1.1
161
- mqttServerDisconnector .disconnect (clientConnectionContext .getChannel (),
162
- "A client (IP: {}) sent a message, that was bigger than the maximum message size. Disconnecting client." ,
163
- "Sent a message that was bigger than the maximum size" ,
164
- Mqtt5DisconnectReasonCode .PACKET_TOO_LARGE ,
165
- ReasonStrings .DISCONNECT_PACKET_TOO_LARGE_MESSAGE ,
166
- Mqtt5UserProperties .NO_USER_PROPERTIES ,
167
- false ,
168
- true );
169
- }
153
+ connectDecoder .decodeProtocolVersion (clientConnectionContext , buf );
154
+ mqttConnacker .connackError (clientConnectionContext .getChannel (),
155
+ "A client (ID: {}, IP: {}) connect packet exceeded the maximum permissible size." ,
156
+ "Sent CONNECT exceeded the maximum permissible size" ,
157
+ Mqtt5ConnAckReasonCode .PACKET_TOO_LARGE ,
158
+ ReasonStrings .CONNACK_PACKET_TOO_LARGE );
159
+
170
160
return null ;
171
161
}
172
162
0 commit comments