Merge branch 'master' into fix/detection-of-close

This commit is contained in:
mhchia
2019-09-21 18:05:54 +08:00
22 changed files with 226 additions and 68 deletions

View File

@ -59,10 +59,6 @@ def encode_varint_prefixed(msg_bytes: bytes) -> bytes:
async def read_varint_prefixed_bytes(reader: Reader) -> bytes:
len_msg = await decode_uvarint_from_stream(reader)
data = await read_exactly(reader, len_msg)
if len(data) != len_msg:
raise ValueError(
f"failed to read enough bytes: len_msg={len_msg}, data={data!r}"
)
return data