mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-04 21:57:43 +03:00
Measure coverage of forked processes
This commit is contained in:
parent
ae99584a7b
commit
e4ee569bd2
2 changed files with 37 additions and 15 deletions
|
@ -133,6 +133,7 @@ class ParallelHTTPServer(ParallelizationMixIn,
|
|||
return super().finish_request(request, client_address)
|
||||
|
||||
def finish_request(self, request, client_address):
|
||||
"""Don't overwrite this! (Modified by tests.)"""
|
||||
with self.connections_guard:
|
||||
return self.finish_request_locked(request, client_address)
|
||||
|
||||
|
@ -164,22 +165,21 @@ class ParallelHTTPSServer(ParallelHTTPServer):
|
|||
ssl_version=self.protocol, ciphers=self.ciphers,
|
||||
do_handshake_on_connect=False)
|
||||
|
||||
def finish_request(self, request, client_address):
|
||||
with self.connections_guard:
|
||||
def finish_request_locked(self, request, client_address):
|
||||
try:
|
||||
try:
|
||||
try:
|
||||
request.do_handshake()
|
||||
except socket.timeout:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise RuntimeError("SSL handshake failed: %s" % e) from e
|
||||
except Exception:
|
||||
try:
|
||||
self.handle_error(request, client_address)
|
||||
finally:
|
||||
self.shutdown_request(request)
|
||||
return
|
||||
return super().finish_request_locked(request, client_address)
|
||||
request.do_handshake()
|
||||
except socket.timeout:
|
||||
raise
|
||||
except Exception as e:
|
||||
raise RuntimeError("SSL handshake failed: %s" % e) from e
|
||||
except Exception:
|
||||
try:
|
||||
self.handle_error(request, client_address)
|
||||
finally:
|
||||
self.shutdown_request(request)
|
||||
return
|
||||
return super().finish_request_locked(request, client_address)
|
||||
|
||||
|
||||
class ServerHandler(wsgiref.simple_server.ServerHandler):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue