Don't start thread in case of SSL error
This commit is contained in:
parent
84c07efd0a
commit
9ebe7933cb
1 changed files with 4 additions and 5 deletions
|
@ -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,11 +45,11 @@ class Server():
|
|||
|
||||
try:
|
||||
session.handle()
|
||||
except (ssl.SSLEOFError, ssl.SSLError):
|
||||
pass
|
||||
|
||||
thread = threading.Thread(target=spawn)
|
||||
thread.start()
|
||||
except (ssl.SSLEOFError, ssl.SSLError):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
hosts = re.split(r'\s*,\s*', self.config.get('listen', 'host'))
|
||||
|
|
Loading…
Add table
Reference in a new issue