INNER CODE UNIT · Python
finish_request
cipi-sh/cipi · lib/cipi-crowdsec-rescue.py:223
def finish_request(self, request, client_address) -> None:
try:
tls = self.ssl_context.wrap_socket(request, server_side=True)
except (OSError, ValueError):
# Port scan, plain HTTP, or a handshake that ran out of time.
return
try:
self.RequestHandlerClass(tls, client_address, self)
finally:
try:
tls.close()
except OSError:
pass
def handle_error(self, request, client_address) -> None:
sys.stderr.write("rescue: connection error from %s\n" % (client_address[0],))