From a6a9ba0754b275b979083c2745f184c8e2c7cfc8 Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Wed, 31 Jul 2024 20:21:04 +0000 Subject: [PATCH] Don't crash on invalid messages & increase char limit for S2S communications --- server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index 98babd3..d3c99f3 100755 --- a/server.py +++ b/server.py @@ -471,7 +471,7 @@ async def connectServer(hostname: str, port: int): try: while 1: 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")) match buffer[0]: case "S": @@ -538,7 +538,7 @@ async def connectServer(hostname: str, port: int): ) ) log( - f"Recieved invalid message ({buffer}) from {sName}", + f"Recieved invalid message ({buffer}) from {rID}", "WARN", ) await writer.drain()