From 38df869fe1e1aeb7dde2a484e85c9850b771d3c5 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Sun, 8 Aug 2021 12:06:09 +0200 Subject: [PATCH] small socket improvement --- tnc/sock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tnc/sock.py b/tnc/sock.py index 64fcb133..4be3b0a4 100644 --- a/tnc/sock.py +++ b/tnc/sock.py @@ -53,7 +53,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler): while True and socketTimeout > time.time(): chunk = self.request.recv(1024) # .strip() data += chunk - if chunk.endswith(b'\n'): + if chunk.endswith(b'}\n') or chunk.endswith(b'}') or chunk.endswith(b'\n'): break data = data[:-1] # remove b'\n' data = str(data, 'utf-8')