etwist/server.py
branchtls-sprint
changeset 1263 01152fffd593
parent 1132 96752791c2b6
parent 1115 1a9e386ebdda
child 1420 25c13e5b12bd
equal deleted inserted replaced
1246:76b3cd5d4f31 1263:01152fffd593
    84         # when we have an in-memory repository, clean unused sessions every XX
    84         # when we have an in-memory repository, clean unused sessions every XX
    85         # seconds and properly shutdown the server
    85         # seconds and properly shutdown the server
    86         if config.repo_method == 'inmemory':
    86         if config.repo_method == 'inmemory':
    87             reactor.addSystemEventTrigger('before', 'shutdown',
    87             reactor.addSystemEventTrigger('before', 'shutdown',
    88                                           self.shutdown_event)
    88                                           self.shutdown_event)
    89             # monkey path start_looping_task to get proper reactor integration
    89             # monkey patch start_looping_task to get proper reactor integration
    90             self.appli.repo.__class__.start_looping_tasks = start_looping_tasks
    90             self.appli.repo.__class__.start_looping_tasks = start_looping_tasks
    91             if config.pyro_enabled():
    91             if config.pyro_enabled():
    92                 # if pyro is enabled, we have to register to the pyro name
    92                 # if pyro is enabled, we have to register to the pyro name
    93                 # server, create a pyro daemon, and create a task to handle pyro
    93                 # server, create a pyro daemon, and create a task to handle pyro
    94                 # requests
    94                 # requests
   180             return self.redirect(req, ex.location)
   180             return self.redirect(req, ex.location)
   181         if https and req.cnx.anonymous_connection:
   181         if https and req.cnx.anonymous_connection:
   182             # don't allow anonymous on https connection
   182             # don't allow anonymous on https connection
   183             return self.request_auth(req)            
   183             return self.request_auth(req)            
   184         if self.url_rewriter is not None:
   184         if self.url_rewriter is not None:
   185             # XXX should occurs before authentication?
   185             # XXX should occur before authentication?
   186             try:
   186             try:
   187                 path = self.url_rewriter.rewrite(host, origpath)
   187                 path = self.url_rewriter.rewrite(host, origpath)
   188             except Redirect, ex:
   188             except Redirect, ex:
   189                 return self.redirect(req, ex.location)
   189                 return self.redirect(req, ex.location)
   190             request.uri.replace(origpath, path, 1)
   190             request.uri.replace(origpath, path, 1)