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