spinel-cli: fix corner case in hdlc parser. (#859)

This commit is contained in:
Martin Turon
2016-10-20 19:52:09 -07:00
committed by Jonathan Hui
parent 24d4eec0a5
commit 5346d81669
+5 -1
View File
@@ -99,7 +99,11 @@ class Hdlc(IStream):
if CONFIG.DEBUG_HDLC:
raw.append(byte)
if byte == HDLC_FLAG:
break
if len(packet) != 0:
break
else:
# If multiple FLAG bytes in a row, keep looking for data.
continue
if byte == HDLC_ESCAPE:
byte = self.stream.read()
if CONFIG.DEBUG_HDLC: