コード例 #1
0
ファイル: testtools.py プロジェクト: alex-docker/flocker
    def __init__(self, counter, method, path, headers, content):

        channel = HTTPChannel()
        host = IPv4Address(b"TCP", b"127.0.0.1", 80)
        channel.makeConnection(StringTransport(hostAddress=host))

        Request.__init__(self, channel, False)

        # An extra attribute for identifying this fake request
        self._counter = counter

        # Attributes a Request is supposed to have but we have to set ourselves
        # because the base class mixes together too much other logic with the
        # code that sets them.
        self.prepath = []
        self.requestHeaders = headers
        self.content = BytesIO(content)

        self.requestReceived(method, path, b"HTTP/1.1")

        # requestReceived initializes the path attribute for us (but not
        # postpath).
        self.postpath = list(map(unquote, self.path[1:].split(b'/')))

        # Our own notifyFinish / finish state because the inherited
        # implementation wants to write confusing stuff to the transport when
        # the request gets finished.
        self._finished = False
        self._finishedChannel = EventChannel()

        # Our own state for the response body so we don't have to dig it out of
        # the transport.
        self._responseBody = b""
コード例 #2
0
    def __init__(self, counter, method, path, headers, content):

        channel = HTTPChannel()
        host = IPv4Address(b"TCP", b"127.0.0.1", 80)
        channel.makeConnection(StringTransport(hostAddress=host))

        Request.__init__(self, channel, False)

        # An extra attribute for identifying this fake request
        self._counter = counter

        # Attributes a Request is supposed to have but we have to set ourselves
        # because the base class mixes together too much other logic with the
        # code that sets them.
        self.prepath = []
        self.requestHeaders = headers
        self.content = BytesIO(content)

        self.requestReceived(method, path, b"HTTP/1.1")

        # requestReceived initializes the path attribute for us (but not
        # postpath).
        self.postpath = list(map(unquote, self.path[1:].split(b'/')))

        # Our own notifyFinish / finish state because the inherited
        # implementation wants to write confusing stuff to the transport when
        # the request gets finished.
        self._finished = False
        self._finishedChannel = EventChannel()

        # Our own state for the response body so we don't have to dig it out of
        # the transport.
        self._responseBody = b""
コード例 #3
0
ファイル: site.py プロジェクト: yvwvnacb/synapse
    def __init__(self, channel, *args, **kw):
        Request.__init__(self, channel, *args, **kw)
        self.site = channel.site
        self._channel = channel  # this is used by the tests
        self.start_time = 0.0

        # The requester, if authenticated. For federation requests this is the
        # server name, for client requests this is the Requester object.
        self.requester = None  # type: Optional[Union[Requester, str]]

        # we can't yet create the logcontext, as we don't know the method.
        self.logcontext = None  # type: Optional[LoggingContext]

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1

        # whether an asynchronous request handler has called processing()
        self._is_processing = False

        # the time when the asynchronous request handler completed its processing
        self._processing_finished_time = None

        # what time we finished sending the response to the client (or the connection
        # dropped)
        self.finish_time = None
コード例 #4
0
ファイル: HydrusServer.py プロジェクト: sttollgrin/hydrus
    def __init__(self, *args, **kwargs):

        Request.__init__(self, *args, **kwargs)

        self.is_hydrus_client = True
        self.hydrus_args = None
        self.hydrus_response_context = None
        self.hydrus_request_data_usage = 0
コード例 #5
0
ファイル: HydrusServer.py プロジェクト: velemi/hydrus
    def __init__(self, *args, **kwargs):

        Request.__init__(self, *args, **kwargs)

        self.start_time = time.clock()
        self.is_hydrus_client = True
        self.hydrus_args = None
        self.hydrus_response_context = None
コード例 #6
0
ファイル: HydrusServer.py プロジェクト: Jade-Stern/hydrus
    def __init__(self, *args, **kwargs):

        Request.__init__(self, *args, **kwargs)

        self.is_hydrus_client = True
        self.hydrus_args = None
        self.hydrus_response_context = None
        self.hydrus_request_data_usage = 0
コード例 #7
0
    def __init__(self, *args, **kwargs):

        Request.__init__(self, *args, **kwargs)

        self.start_time = time.clock()
        self.parsed_request_args = None
        self.hydrus_response_context = None
        self.hydrus_account = None
コード例 #8
0
ファイル: site.py プロジェクト: rubo77/synapse
    def __init__(self, site, *args, **kw):
        Request.__init__(self, *args, **kw)
        self.site = site
        self.authenticated_entity = None
        self.start_time = 0

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1
コード例 #9
0
ファイル: HydrusServer.py プロジェクト: HOZHENWAI/hydrus
 def __init__( self, *args, **kwargs ):
     
     Request.__init__( self, *args, **kwargs )
     
     self.start_time = HydrusData.GetNowPrecise()
     self.parsed_request_args = None
     self.hydrus_response_context = None
     self.hydrus_account = None
     self.client_api_permissions = None
コード例 #10
0
ファイル: site.py プロジェクト: thegcat/synapse
    def __init__(self, site, *args, **kw):
        Request.__init__(self, *args, **kw)
        self.site = site
        self.authenticated_entity = None
        self.start_time = 0

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1
コード例 #11
0
ファイル: site.py プロジェクト: xorob0/synapse
    def __init__(self, channel, *args, **kw):
        Request.__init__(self, channel, *args, **kw)
        self.site = channel.site
        self._channel = channel  # this is used by the tests
        self.authenticated_entity = None
        self.start_time = 0

        # we can't yet create the logcontext, as we don't know the method.
        self.logcontext = None

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1

        # whether an asynchronous request handler has called processing()
        self._is_processing = False

        # the time when the asynchronous request handler completed its processing
        self._processing_finished_time = None

        # what time we finished sending the response to the client (or the connection
        # dropped)
        self.finish_time = None
コード例 #12
0
ファイル: site.py プロジェクト: DoubleMalt/synapse
    def __init__(self, site, channel, *args, **kw):
        Request.__init__(self, channel, *args, **kw)
        self.site = site
        self._channel = channel     # this is used by the tests
        self.authenticated_entity = None
        self.start_time = 0

        # we can't yet create the logcontext, as we don't know the method.
        self.logcontext = None

        global _next_request_seq
        self.request_seq = _next_request_seq
        _next_request_seq += 1

        # whether an asynchronous request handler has called processing()
        self._is_processing = False

        # the time when the asynchronous request handler completed its processing
        self._processing_finished_time = None

        # what time we finished sending the response to the client (or the connection
        # dropped)
        self.finish_time = None
コード例 #13
0
ファイル: delayrequest.py プロジェクト: 89sos98/firefly
 def __init__(self, *args, **kw):
     Request.__init__(self,*args, **kw)
コード例 #14
0
ファイル: bootstrap.py プロジェクト: clownpie/http2osc
 def __init__(self, *args, **kw):
     Request.__init__(self, *args, **kw)
     self.context = Context(self)
コード例 #15
0
 def __init__(self, args, **kw):
     Request.__init__(self, *args, **kw)
     self.transmit_parameter = {}
コード例 #16
0
ファイル: foundation.py プロジェクト: notoriousno/shiji
 def __init__(self, channel, queued):
     return Request.__init__(self, channel, queued)
コード例 #17
0
ファイル: site.py プロジェクト: 0-T-0/synapse
 def __init__(self, site, *args, **kw):
     Request.__init__(self, *args, **kw)
     self.site = site
     self.authenticated_entity = None
     self.start_time = 0
コード例 #18
0
ファイル: homeserver.py プロジェクト: roblabla/synapse
 def __init__(self, site, *args, **kw):
     Request.__init__(self, *args, **kw)
     self.site = site
     self.authenticated_entity = None
     self.start_time = 0
コード例 #19
0
ファイル: delayrequest.py プロジェクト: zzl133/firefly_study
 def __init__(self, *args, **kw):
     Request.__init__(self, *args, **kw)
コード例 #20
0
	def __init__(self, *args, **kwargs):
		Request.__init__(self, *args, **kwargs)
		self._authenticated_callbacks = []
		self.__fix_twisted()
		self.notify_on_authenticated(self.__store_ip_in_session)
		self.notify_on_authenticated(self.__add_sso_session)
コード例 #21
0
 def __init__(self, channel, queued):
     return Request.__init__(self, channel, queued)