Don't start thread in case of SSL error

This commit is contained in:
XANTRONIX 2025-04-09 09:50:03 -04:00
parent 84c07efd0a
commit 9ebe7933cb

View file

@ -1,5 +1,4 @@
import re
import enum
import threading
import socket
import selectors
@ -38,7 +37,7 @@ class Server():
try:
sock, addr = listener.accept()
except ssl.SSLError as e:
except ssl.SSLError:
return
def spawn():
@ -46,12 +45,12 @@ class Server():
try:
session.handle()
thread = threading.Thread(target=spawn)
thread.start()
except (ssl.SSLEOFError, ssl.SSLError):
pass
thread = threading.Thread(target=spawn)
thread.start()
def run(self):
hosts = re.split(r'\s*,\s*', self.config.get('listen', 'host'))
port = int(self.config.get('listen', 'port'))