Exemplo n.º 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 = []
Exemplo n.º 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 = []
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 6
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
Exemplo n.º 7
0
 def outConnectEvent(self):
     ProtocolWrapper.connectionMade(self)
Exemplo n.º 8
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()
Exemplo n.º 10
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     if self.tlsStarted and self.isClient and not self.helloDone:
         self._clientHello()
Exemplo n.º 11
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
Exemplo n.º 12
0
 def outConnectEvent(self):
     ProtocolWrapper.connectionMade(self)
Exemplo n.º 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()
Exemplo n.º 15
0
 def connectionMade(self):
     connected = True
     if not self.challenge:
         ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())
Exemplo n.º 16
0
 def connectionMade(self):
     ProtocolWrapper.connectionMade(self)
     log.msg("Opening connection with %s" % self.transport.getPeer())