|
|
@ -43,17 +43,21 @@ def print_protobuf_message(message_type):
|
|
|
|
print('CLOSE', message_type)
|
|
|
|
print('CLOSE', message_type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_UVARINT_DUMP_BUFFER = bytearray(1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UVarintType:
|
|
|
|
class UVarintType:
|
|
|
|
WIRE_TYPE = 0
|
|
|
|
WIRE_TYPE = 0
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def dump(target, value):
|
|
|
|
async def dump(target, value):
|
|
|
|
shifted_value = True
|
|
|
|
shifted = True
|
|
|
|
while shifted_value:
|
|
|
|
while shifted:
|
|
|
|
shifted_value = value >> 7
|
|
|
|
shifted = value >> 7
|
|
|
|
yield from target.write(chr((value & 0x7F) | (
|
|
|
|
_UVARINT_DUMP_BUFFER[0] = (value & 0x7F) | (
|
|
|
|
0x80 if shifted_value != 0 else 0x00)))
|
|
|
|
0x80 if shifted else 0x00)
|
|
|
|
value = shifted_value
|
|
|
|
await target.write(_UVARINT_DUMP_BUFFER)
|
|
|
|
|
|
|
|
value = shifted
|
|
|
|
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
@staticmethod
|
|
|
|
def load(source):
|
|
|
|
def load(source):
|
|
|
|