small socket improvement

This commit is contained in:
DJ2LS 2021-08-08 12:06:09 +02:00 committed by GitHub
parent 143d39316e
commit 38df869fe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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')