(self, request, client_address)
Fork a new subprocess to process the request.
Fork a new subprocess to process the request.
Fork a new subprocess to process the request .
def process_request(self, request, client_address):
        """Fork a new subprocess to process the request."""
        self.collect_children()
        pid = os.fork()
        if pid:
            # Parent process
            if self.active_children is None:
                self.active_children = []
            self.active_children.append(pid)
            self.close_request(request)
        else:
            # Child process.
            # This must never return, hence os._exit()!
            try:
                self.finish_request(request, client_address)
                self.shutdown_request(request)
                os._exit(0)
            except:
                try:
                    self.handle_error(request, client_address)
                    self.shutdown_request(request)
                finally:
                    os._exit(1)
def process_request ( self , request , client_address ) : self . collect_children ( ) pid = os . fork ( ) if pid : # Parent process if self . active_children is None : self . active_children = [ ] self . active_children . append ( pid ) self . close_request ( request ) else : # Child process. # This must never return, hence os._exit()! try : self . finish_request ( request , client_address ) self . shutdown_request ( request ) os . _exit ( 0 ) except : try : self . handle_error ( request , client_address ) self . shutdown_request ( request ) finally : os . _exit ( 1 )