Browse Source

Suppress possible timeout errors on following packet readouts

pull/14/head
Richard Neumann 3 years ago
parent
commit
c3b40a6f0a
  1. 2
      rcon/source/proto.py

2
rcon/source/proto.py

@ -2,6 +2,7 @@
from __future__ import annotations from __future__ import annotations
from asyncio import StreamReader from asyncio import StreamReader
from contextlib import suppress
from enum import Enum from enum import Enum
from functools import partial from functools import partial
from logging import getLogger from logging import getLogger
@ -116,6 +117,7 @@ class Packet(NamedTuple):
# Attempt to read following packets on large responses. # Attempt to read following packets on large responses.
if size >= max_pkg_size: if size >= max_pkg_size:
with suppress(TimeoutError):
payload += cls.read(file, max_pkg_size=max_pkg_size).payload payload += cls.read(file, max_pkg_size=max_pkg_size).payload
return cls(id_, type_, payload, terminator) return cls(id_, type_, payload, terminator)

Loading…
Cancel
Save