Skip to content
Snippets Groups Projects
Commit 77fbcb3c authored by Vo Minh Thu's avatar Vo Minh Thu
Browse files

[FIX] websrv_lib: the auth provider was instanciated once and

the auth proxy was instanciated multiple times (once per handler instcance).
The previous refactoring merged the proxy and the provider in one class which
once instanciated once. Now it is instanciated once per handler, which is
better.

bzr revid: vmt@openerp.com-20110909122856-29uhsjfe193fqdi8
parent 9ca78ea0
No related branches found
No related tags found
No related merge requests found
......@@ -103,13 +103,13 @@ class HTTPDir:
def instanciate_handler(self, request, client_address, server):
handler = self.handler(noconnection(request), client_address, server)
if self.auth_provider:
handler.auth_provider = self.auth_provider
handler.auth_provider = self.auth_provider()
return handler
def reg_http_service(path, handler, auth_provider=None, secure_only=False):
""" Register a HTTP handler at a given path.
The auth_provider will be set on the handler instances.
The auth_provider will be instanciated and set on the handler instances.
"""
global handlers
service = HTTPDir(path, handler, auth_provider, secure_only)
......
......@@ -308,7 +308,7 @@ def on_starting(server):
config = openerp.tools.config
config['addons_path'] = '/home/openerp/repos/addons/trunk-xmlrpc' # need a config file
config['static_http_document_root'] = '/tmp'
config['log_level'] = 10 # debug
#config['log_level'] = 10 # debug
#openerp.tools.cache = kill_workers_cache
openerp.netsvc.init_logger()
openerp.osv.osv.start_object_proxy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment