MCPcopy Index your code
hub / github.com/python/cpython / process_request

Method process_request

Lib/socketserver.py:612–635  ·  view source on GitHub ↗

Fork a new subprocess to process the request.

(self, request, client_address)

Source from the content-addressed store, hash-verified

610 self.collect_children()
611
612 def process_request(self, request, client_address):
613 """Fork a new subprocess to process the request."""
614 pid = os.fork()
615 if pid:
616 # Parent process
617 if self.active_children is None:
618 self.active_children = set()
619 self.active_children.add(pid)
620 self.close_request(request)
621 return
622 else:
623 # Child process.
624 # This must never return, hence os._exit()!
625 status = 1
626 try:
627 self.finish_request(request, client_address)
628 status = 0
629 except Exception:
630 self.handle_error(request, client_address)
631 finally:
632 try:
633 self.shutdown_request(request)
634 finally:
635 os._exit(status)
636
637 def server_close(self):
638 super().server_close()

Callers

nothing calls this directly

Calls 7

setFunction · 0.85
addMethod · 0.45
close_requestMethod · 0.45
finish_requestMethod · 0.45
handle_errorMethod · 0.45
shutdown_requestMethod · 0.45
_exitMethod · 0.45

Tested by

no test coverage detected