[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
This commit is contained in:
parent
9ca78ea013
commit
77fbcb3c79
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue