Exemplo n.º 1
0
 def _init_request_processor(self, req):
     log_debug(3)
     # Override the parent class's behaviour
     # figure out what kind of request handler we need to instantiate
     if req.method == "POST":
         self._req_processor = apachePOST(self.clientVersion, req)
         return apache.OK
     if req.method == "GET":
         try:
             self._req_processor = apacheGET(self.clientVersion, req)
         except HandlerNotFoundError, e:
             log_error("Unable to handle GET request for server %s" %
                 (e.args[0], ))
             return apache.HTTP_METHOD_NOT_ALLOWED
         # We want to give the request processor the ability to override
         # the default behaviour of calling _setSessionToken
         # XXX This is a but kludgy - misa 20040827
         if hasattr(self._req_processor, 'init_request'):
             if not self._req_processor.init_request():
                 return apache.HTTP_METHOD_NOT_ALLOWED
             # Request initialized
             return apache.OK
         token = self._setSessionToken(req.headers_in)
         if token is None:
             return apache.HTTP_METHOD_NOT_ALLOWED
         return apache.OK
Exemplo n.º 2
0
 def _init_request_processor(self, req):
     log_debug(3)
     # Override the parent class's behaviour
     # figure out what kind of request handler we need to instantiate
     if req.method == "POST":
         self._req_processor = apachePOST(self.clientVersion, req)
         return apache.OK
     if req.method == "GET":
         try:
             self._req_processor = apacheGET(self.clientVersion, req)
         except HandlerNotFoundError, e:
             log_error("Unable to handle GET request for server %s" %
                       (e.args[0], ))
             return apache.HTTP_METHOD_NOT_ALLOWED
         token = self._setSessionToken(req.headers_in)
         if token is None:
             return apache.HTTP_METHOD_NOT_ALLOWED
         return apache.OK