Пример #1
0
    def doRead(self):
        self.buff += os.read(self.rd_fd, 65536)

        while 1:
            (msg, self.buff) = DR2DPMessage1.recv_from_buffer(self.buff)
            if msg != None:
                self.handle_msg(msg)
            else:
                break
Пример #2
0
    def dataReceived(self, data):
        """
        Read data from Click DR and pass it to the Decoy Proxy.
        """

        self.buff += data
        while 1:
            (msg, self.buff) = DR2DPMessage1.recv_from_buffer(self.buff)
            if msg != None:
                self.handle_msg(msg)
            else:
                break
Пример #3
0
    def dataReceived(self, new_data):
        self.recv_buffer += new_data

        # It's possible for more than one message to come in as part
        # of one read, at least in theory.  Therefore we consume as
        # much of the buffer as possible, not just the first message.
        while 1:
            (msg, self.recv_buffer) = DR2DPMessage1.recv_from_buffer(
                self.recv_buffer)
            if msg != None:
                self.handle_msg(msg)
            else:
                break
Пример #4
0
    def dataReceived(self, new_data):
        DEBUG and log_debug(
            'SrcProtocol.dataReceived(%d bytes)' % len(new_data))

        self.recv_buffer += new_data
        #print 'got something from DR!'
        # It's possible for more than one message to come in as part
        # of one read, at least in theory.  Therefore we consume as
        # much of the buffer as possible, not just the first message.
        #
        while 1:
            # print 'LEN %d' % len(self._recv_buffer)
            (msg, self.recv_buffer) = DR2DPMessage1.recv_from_buffer(
                self.recv_buffer)
            if msg != None:
                self.handle_msg(msg)
            else:
                break