示例#1
0
 def connectionMade(self):
     """
     Log the new connection and initialize the buffer list.
     """
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
     self._buffer = []
示例#2
0
 def connectionMade(self):
     """
     Log the new connection and initialize the buffer list.
     """
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
     self._buffer = []
示例#3
0
    def dataReceived(self, data):
        """
        Append the data to the buffer list and parse the whole.
        """
        self._buffer.append(data)

        if self.challenge:
            buf = "".join(self._buffer)
            if len(buf) >= 8:
                challenge, buf = buf[:8], buf[8:]
                self._buffer = [buf]
                nonce = self.challenge(challenge)
                self.transport.write(nonce)
                self.challenge = None
                if self.connected:
                    ProtocolWrapper.connectionMade(self)
                self.dataReceived("")  # Kick it off proper
                if self.pending_dc:
                    self.pending_dc = False
                    self.loseConnection()
        else:
            self._parseFrames()
            if self._pending_frames:
                self._sendFrames()

        self._parseFrames()
示例#4
0
    def dataReceived(self, data):
        """
        Append the data to the buffer list and parse the whole.
        """
        self._buffer.append(data)

        if self.challenge:
            buf = "".join(self._buffer)
            if len(buf) >= 8:
                challenge, buf = buf[:8], buf[8:]
                self._buffer = [buf]
                nonce = self.challenge(challenge)
                self.transport.write(nonce)
                self.challenge = None
                if self.connected:
                    ProtocolWrapper.connectionMade(self)
                self.dataReceived("") # Kick it off proper
                if self.pending_dc:
                    self.pending_dc = False
                    self.loseConnection()
        else:
            self._parseFrames()
            if self._pending_frames:
                self._sendFrames()

        self._parseFrames()
示例#5
0
 def dataReceived(self, data):
     self.buf += data
     if self.challenge:
         if len(self.buf) >= 8:
             challenge, self.buf = self.buf[:8], self.buf[8:]
             nonce = self.challenge(challenge)
             self.transport.write(nonce)
             self.challenge = None
             if self.connected:
                 ProtocolWrapper.connectionMade(self)
             self.dataReceived("") # Kick it off proper
             if self.pending_dc:
                 self.pending_dc = False
                 self.loseConnection()
     else:
         self.parseFrames()
         if self._pending_frames:
             self.sendFrames()
示例#6
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
 def outConnectEvent(self):
     ProtocolWrapper.connectionMade(self)
 def connectionMade(self):
     try:
         ProtocolWrapper.connectionMade(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
 def connectionMade(self):
     if debug:
         print 'TwistedProtocolWrapper.connectionMade'
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
示例#10
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
示例#11
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
示例#12
0
 def outConnectEvent(self):
     ProtocolWrapper.connectionMade(self)
示例#13
0
 def connectionMade(self):
     try:
         ProtocolWrapper.connectionMade(self)
     except TLSError, e:
         self.connectionLost(Failure(e))
         ProtocolWrapper.loseConnection(self)
 def connectionMade(self):
     if debug:
         print 'TwistedProtocolWrapper.connectionMade'
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
示例#15
0
 def connectionMade(self):
     connected = True
     if not self.challenge:
         ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
示例#16
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())