Delay SSL handshake
This commit is contained in:
parent
17127d97a6
commit
49d35cf618
@ -87,9 +87,12 @@ class ParallelHTTPServer(ParallelizationMixIn,
|
|||||||
socket_.settimeout(self.client_timeout)
|
socket_.settimeout(self.client_timeout)
|
||||||
return socket_, address
|
return socket_, address
|
||||||
|
|
||||||
|
def finish_request_locked(self, request, client_address):
|
||||||
|
return super().finish_request(request, client_address)
|
||||||
|
|
||||||
def finish_request(self, request, client_address):
|
def finish_request(self, request, client_address):
|
||||||
with self.connections_guard:
|
with self.connections_guard:
|
||||||
return super().finish_request(request, client_address)
|
return self.finish_request_locked(request, client_address)
|
||||||
|
|
||||||
def handle_error(self, request, client_address):
|
def handle_error(self, request, client_address):
|
||||||
if issubclass(sys.exc_info()[0], socket.timeout):
|
if issubclass(sys.exc_info()[0], socket.timeout):
|
||||||
@ -131,6 +134,7 @@ class ParallelHTTPSServer(ParallelHTTPServer):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def finish_request(self, request, client_address):
|
def finish_request(self, request, client_address):
|
||||||
|
with self.connections_guard:
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
request.do_handshake()
|
request.do_handshake()
|
||||||
@ -144,7 +148,7 @@ class ParallelHTTPSServer(ParallelHTTPServer):
|
|||||||
finally:
|
finally:
|
||||||
self.shutdown_request(request)
|
self.shutdown_request(request)
|
||||||
return
|
return
|
||||||
return super().finish_request(request, client_address)
|
return super().finish_request_locked(request, client_address)
|
||||||
|
|
||||||
|
|
||||||
class ServerHandler(wsgiref.simple_server.ServerHandler):
|
class ServerHandler(wsgiref.simple_server.ServerHandler):
|
||||||
|
Loading…
Reference in New Issue
Block a user