Browse Source

Fixed terminator check on Packet.aread().

pull/2/head 1.3.2
Richard Neumann 4 years ago
parent
commit
2a5ee41b51
  1. 4
      rcon/proto.py

4
rcon/proto.py

@ -110,10 +110,10 @@ class Packet(NamedTuple):
payload = await file.read(size - 10)
terminator = await file.read(2)
if terminator != TERMINATOR:
if (terminator := terminator.decode()) != TERMINATOR:
LOGGER.warning('Unexpected terminator: %s', terminator)
return cls(id_, type_, payload.decode(), terminator.decode())
return cls(id_, type_, payload.decode(), terminator)
@classmethod
def read(cls, file: IO) -> Packet:

Loading…
Cancel
Save