Beispiel #1
0
    def worker_routine(self, socket):
        if self._key_storage:
            socket = Connection(self._ssl_context, socket)
            socket.setup_ssl()
            socket.set_accept_state()
            socket.accept_ssl()

        socket_proc = SocketProcessor(socket)

        try:
            self.process(socket_proc)
            socket_proc.close_socket()
        except Exception, err:
            socket_proc.close_socket(force=True)
            raise err
Beispiel #2
0
    def worker_routine(self, reduced_socket):
        fd = rebuild_handle(reduced_socket)
        sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
        mp.forking.close(fd)

        if self._key_storage:
            sock = Connection(self._ssl_context, sock)
            sock.setup_ssl()
            sock.set_accept_state()
            sock.accept_ssl()

        socket_proc = SocketProcessor(sock)

        try:
            self.process(socket_proc)
            socket_proc.close_socket()
        except Exception, err:
            socket_proc.close_socket(force=True)
            raise err