message read length fix

This commit is contained in:
Robert Zajac 2018-11-12 12:26:11 -05:00
parent 61e11a2716
commit 6e3857c89a
2 changed files with 3 additions and 3 deletions

View File

@ -92,9 +92,9 @@ class MuxedConn(IMuxedConn):
data += chunk
header, end_index = decode_uvarint(data, 0)
length, end_index = decode_uvarint(data, end_index + 1)
length, end_index = decode_uvarint(data, end_index)
message = data[-length:]
message = data[end_index:end_index + length + 1]
# Deal with other types of messages
flag = header & 0x07

View File

@ -22,4 +22,4 @@ def decode_uvarint(buff, index):
break
index += 1
return result, index
return result, index + 1