Don't crash on invalid messages & increase char limit for S2S communications
This commit is contained in:
parent
a6ecd9a129
commit
a6a9ba0754
1 changed files with 2 additions and 2 deletions
|
@ -471,7 +471,7 @@ async def connectServer(hostname: str, port: int):
|
||||||
try:
|
try:
|
||||||
while 1:
|
while 1:
|
||||||
try:
|
try:
|
||||||
rawMsg = await asyncio.wait_for(reader.read(967), 0.1)
|
rawMsg = await asyncio.wait_for(reader.read(1024), 0.1)
|
||||||
buffer = raw(rawMsg.decode("utf8"))
|
buffer = raw(rawMsg.decode("utf8"))
|
||||||
match buffer[0]:
|
match buffer[0]:
|
||||||
case "S":
|
case "S":
|
||||||
|
@ -538,7 +538,7 @@ async def connectServer(hostname: str, port: int):
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
log(
|
log(
|
||||||
f"Recieved invalid message ({buffer}) from {sName}",
|
f"Recieved invalid message ({buffer}) from {rID}",
|
||||||
"WARN",
|
"WARN",
|
||||||
)
|
)
|
||||||
await writer.drain()
|
await writer.drain()
|
||||||
|
|
Loading…
Reference in a new issue