Exemple #1
0
    def frombytes(cls, byte_string):
        """
        Parse an AWS request from a byte string.

        @param byte_string: The request as parsed from a C{.req} file.
        @type byte_string: L{bytes}

        @return: A request object.
        @rtype: L{_AWSRequest}
        """
        # Ensure there's a blank line so that status and header
        # parsing completes.
        blank_line = b'\n\n'
        if blank_line not in byte_string:
            byte_string += blank_line

        channel = HTTPChannel()
        channel.delimiter = b'\n'
        channel.makeConnection(StringTransport())
        channel.dataReceived(byte_string)
        channel.connectionLost(ConnectionDone())
        request = channel.requests[-1]

        method = request.method
        path = request.uri
        headers = dict(request.requestHeaders.getAllRawHeaders())
        # what comes after the empty line is a
        body = byte_string.split(blank_line, 1)[-1]

        return cls(method, path, headers, body)
Exemple #2
0
 def connectionLost(self, reason):
     self.site.lostClient()
     HTTPChannel.connectionLost(self, reason)
Exemple #3
0
 def connectionLost(self, reason):
     HTTPChannel.connectionLost(self, reason)
     self.site._lost_client()
Exemple #4
0
 def connectionLost(self, reason):
     HTTPChannel.connectionLost(self, reason)
     self.site._lost_client()
 def connectionLost(self, reason):
     print "connectionLost in MyHTTPChannel. channel is ", self
     HTTPChannel.connectionLost(self,reason)
Exemple #6
0
 def connectionLost(self, reason):
     self.site.lostClient()
     HTTPChannel.connectionLost(self, reason)
Exemple #7
0
    def connectionLost(self, reason):
        self.log.debug('Connection lost from client: %s', reason)
        if (self.proxyConnection is not None):
            self.proxyConnection.transport.loseConnection()

        HTTPChannel.connectionLost(self, reason)
Exemple #8
0
	def connectionLost(self, reason):
		printStatus("Connection lost to: "+self.transport.getPeer().host)
		HTTPChannel.connectionLost(self, reason)
    def connectionLost(self, reason):
        logging.debug("Connection lost from client: " + str(reason))
        if (self.proxyConnection is not None):
            self.proxyConnection.transport.loseConnection()

        HTTPChannel.connectionLost(self, reason)
Exemple #10
0
    def connectionLost(self, reason):
        self.log.debug('Connection lost from client: %s', reason)
        if (self.proxyConnection is not None):
            self.proxyConnection.transport.loseConnection()

        HTTPChannel.connectionLost(self, reason)
    def connectionLost(self, reason):
        logging.debug("Connection lost from client: " + str(reason))
        if (self.proxyConnection is not None):
            self.proxyConnection.transport.loseConnection()

        HTTPChannel.connectionLost(self, reason)
Exemple #12
0
 def connectionLost(self, reason):
     HTTPChannel.connectionLost(self, reason)
     self._connection_lost.callback(None)