Fixing issue #72: Setting minimum message length to 2.

Signed-off-by: seko24 <seb12@mailbox.org>
This commit is contained in:
seko24
2017-08-09 09:35:38 +02:00
parent 7099531e0e
commit e12682056c
2 changed files with 2 additions and 2 deletions

View File

@@ -390,7 +390,7 @@ int MQTTSN::Client<Network, Timer, MAX_PACKET_SIZE, b>::readPacket(Timer& timer)
int lenlen = 0;
int datalen = 0;
#define MQTTSN_MIN_PACKET_LENGTH 3
#define MQTTSN_MIN_PACKET_LENGTH 2
// 1. read the packet, datagram style
if ((len = ipstack.read(readbuf, MAX_PACKET_SIZE, timer.left_ms())) < MQTTSN_MIN_PACKET_LENGTH)
goto exit;

View File

@@ -248,7 +248,7 @@ int MQTTSNstrlen(MQTTSNString MQTTSNString)
int MQTTSNPacket_read(unsigned char* buf, int buflen, int (*getfn)(unsigned char*, int))
{
int rc = MQTTSNPACKET_READ_ERROR;
const int MQTTSN_MIN_PACKET_LENGTH = 3;
const int MQTTSN_MIN_PACKET_LENGTH = 2;
int len = 0; /* the length of the whole packet including length field */
int lenlen = 0;
int datalen = 0;