Esempio n. 1
0
 def cleanupHandler(self, req):
     """
     clean up this session
     """
     log_debug(3)
     self.lang = "C"
     self.clientVersion = self.proxyVersion = 0
     # clear the global flags
     rhnFlags.reset()
     timer(self.start_time)
     return self._cleanup_request_processor()
Esempio n. 2
0
 def cleanupHandler(self, _req):
     """
     clean up this session
     """
     log_debug(3)
     self.lang = "C"
     self.clientVersion = self.proxyVersion = 0
     # clear the global flags
     rhnFlags.reset()
     timer(self.start_time)
     return self._cleanup_request_processor()
Esempio n. 3
0
    def headerParserHandler(self, req):
        """
        after a request has been received, first thing we do is to create the
        input object
        """
        # pylint: disable=R0911

        log_setreq(req)
        log_debug(3)
        self.start_time = time.time()
        # Decline if this is a subrequest:
        if req.main:
            return apache.DECLINED
        log_debug(4, req.method, req.path_info, req.headers_in)

        # Clear the global flags.
        rhnFlags.reset()
        # Init the transport options.
        rhnFlags.set('outputTransportOptions', UserDictCase())
        # Init the session token dictionary.
        rhnFlags.set("AUTH_SESSION_TOKEN", UserDictCase())

        ret = self._init_request_processor(req)
        if ret != apache.OK:
            return ret

        ret = self._set_client_info(req)
        if ret != apache.OK:
            return ret

        # Check the protocol version
        if req.proto_num < 1001:
            # HTTP protocols prior to 1.1 close the connection
            rhnFlags.get('outputTransportOptions')["Connection"] = "close"

        ret = self._set_proxy_info(req)
        if ret != apache.OK:
            return ret

        # Need to run _set_other first, since _set_lang needs RoodDir set
        ret = self._set_other(req)
        if ret != apache.OK:
            return ret

        ret = self._set_lang(req)
        if ret != apache.OK:
            return ret

        return apache.OK
Esempio n. 4
0
    def headerParserHandler(self, req):
        """
        after a request has been received, first thing we do is to create the
        input object
        """
        # pylint: disable=R0911

        log_setreq(req)
        log_debug(3)
        self.start_time = time.time()
        # Decline if this is a subrequest:
        if req.main:
            return apache.DECLINED
        log_debug(4, req.method, req.path_info, req.headers_in)

        # Clear the global flags.
        rhnFlags.reset()
        # Init the transport options.
        rhnFlags.set('outputTransportOptions', UserDictCase())
        # Init the session token dictionary.
        rhnFlags.set("AUTH_SESSION_TOKEN", UserDictCase())

        ret = self._init_request_processor(req)
        if ret != apache.OK:
            return ret

        ret = self._set_client_info(req)
        if ret != apache.OK:
            return ret

        # Check the protocol version
        if req.proto_num < 1001:
            # HTTP protocols prior to 1.1 close the connection
            rhnFlags.get('outputTransportOptions')["Connection"] = "close"

        ret = self._set_proxy_info(req)
        if ret != apache.OK:
            return ret

        # Need to run _set_other first, since _set_lang needs RoodDir set
        ret = self._set_other(req)
        if ret != apache.OK:
            return ret

        ret = self._set_lang(req)
        if ret != apache.OK:
            return ret

        return apache.OK