Fix SSLEOFError handler by moving into thread context
This commit is contained in:
parent
32281a3aa2
commit
9cb8b2e0e4
1 changed files with 9 additions and 8 deletions
|
@ -50,17 +50,18 @@ class Server():
|
||||||
return listener
|
return listener
|
||||||
|
|
||||||
def accept(self, listener):
|
def accept(self, listener):
|
||||||
try:
|
|
||||||
sock, addr = listener.accept()
|
sock, addr = listener.accept()
|
||||||
|
|
||||||
def spawn():
|
def spawn():
|
||||||
session = Session(self, sock)
|
session = Session(self, sock)
|
||||||
|
|
||||||
|
try:
|
||||||
session.handle()
|
session.handle()
|
||||||
|
except (ssl.SSLError, ssl.SSLEOFError) as e:
|
||||||
|
pass
|
||||||
|
|
||||||
thread = threading.Thread(target=spawn)
|
thread = threading.Thread(target=spawn)
|
||||||
thread.start()
|
thread.start()
|
||||||
except ssl.SSLEOFError as e:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
port = int(self.config['listen']['port'])
|
port = int(self.config['listen']['port'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue