Update server.py

This commit is contained in:
Nova Cat 2025-02-05 12:35:30 -08:00
parent 91b3d817bc
commit e2366da77e

View file

@ -241,6 +241,8 @@ def session(connection, client, ip, isssl=False):
pendingCommands = "" # list of commands that were executed before verification pendingCommands = "" # list of commands that were executed before verification
unfinished = False unfinished = False
textt = "" textt = ""
nonlocal last_ping
nonlocal ping_pending
last_ping = time.time() last_ping = time.time()
ping_pending = False ping_pending = False
pendingSend = "" # Text that should be sent to the client pendingSend = "" # Text that should be sent to the client
@ -863,9 +865,9 @@ def ssl_session(sock):
ctx.use_privatekey_file(ssl_pkey) ctx.use_privatekey_file(ssl_pkey)
ctx.use_certificate_chain_file(ssl_cert) ctx.use_certificate_chain_file(ssl_cert)
conn = SSL.Connection(ctx, connection) conn = SSL.Connection(ctx, connection)
conn.settimeout(5)
conn.set_accept_state() conn.set_accept_state()
conn.do_handshake() conn.do_handshake()
conn.settimeout(5)
threading.Thread(target=session, daemon=True, args=[conn, client, ip_to, True]).start() threading.Thread(target=session, daemon=True, args=[conn, client, ip_to, True]).start()
except: except:
print("Something went wrong...") print("Something went wrong...")