message read length fix
This commit is contained in:
parent
61e11a2716
commit
6e3857c89a
@ -92,9 +92,9 @@ class MuxedConn(IMuxedConn):
|
|||||||
data += chunk
|
data += chunk
|
||||||
|
|
||||||
header, end_index = decode_uvarint(data, 0)
|
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
|
# Deal with other types of messages
|
||||||
flag = header & 0x07
|
flag = header & 0x07
|
||||||
|
@ -22,4 +22,4 @@ def decode_uvarint(buff, index):
|
|||||||
break
|
break
|
||||||
index += 1
|
index += 1
|
||||||
|
|
||||||
return result, index
|
return result, index + 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user