fix(backend_server.py): fix double disconnect if client.inbound empty

This commit is contained in:
2026-03-03 22:20:36 +01:00
parent 332238b403
commit 88d349090e

View File

@@ -210,7 +210,7 @@ class BackendServer:
""" """
self.logger.info(f"[-] Disconnecting {client}...") self.logger.info(f"[-] Disconnecting {client}...")
if client.socket is None: if client.socket is None or client.socket._closed:
self.logger.warning( self.logger.warning(
f"Client {client} has no socket, nothing to disconnect." f"Client {client} has no socket, nothing to disconnect."
) )
@@ -274,9 +274,6 @@ class BackendServer:
try: try:
if mask & selectors.EVENT_READ: if mask & selectors.EVENT_READ:
self._receive_inbound(sock, client) self._receive_inbound(sock, client)
if not client.inbound:
self._disconnect(client)
return
while b"\n" in client.inbound: while b"\n" in client.inbound:
line, client.inbound = client.inbound.split(b"\n", 1) line, client.inbound = client.inbound.split(b"\n", 1)