summaryrefslogtreecommitdiffstats
path: root/ipa-server
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2007-10-12 10:37:36 -0400
committerRob Crittenden <rcritten@redhat.com>2007-10-12 10:37:36 -0400
commit95f0c52013270fd83e33c480254a8001211fe9fa (patch)
tree9fee9d6e6d37d22d5c317c6b74ea09999144c35d /ipa-server
parentd2c73bfd4dc48206b9ca2bc59d7fa6b04c2c5bf6 (diff)
downloadfreeipa-95f0c52013270fd83e33c480254a8001211fe9fa.tar.gz
freeipa-95f0c52013270fd83e33c480254a8001211fe9fa.tar.xz
freeipa-95f0c52013270fd83e33c480254a8001211fe9fa.zip
Remove buggy connection caching. Create a new connection for each LDAP
request.
Diffstat (limited to 'ipa-server')
-rw-r--r--ipa-server/xmlrpc-server/funcs.py43
1 files changed, 7 insertions, 36 deletions
diff --git a/ipa-server/xmlrpc-server/funcs.py b/ipa-server/xmlrpc-server/funcs.py
index 86c12065f..517d54a78 100644
--- a/ipa-server/xmlrpc-server/funcs.py
+++ b/ipa-server/xmlrpc-server/funcs.py
@@ -68,19 +68,14 @@ class IPAConnPool:
def getConn(self, host, port, krbccache=None, debug=None):
conn = None
+
ccache = krbV.CCache(name=krbccache, context=self._ctx)
cprinc = ccache.principal()
- self._lock.acquire()
- try:
- try:
- conn = self._dict[cprinc.name]
- del self._dict[cprinc.name]
- self._lru.remove(cprinc.name)
- except KeyError:
- conn = ipaserver.ipaldap.IPAdmin(host,port,None,None,None,debug)
- conn.set_krbccache(krbccache, cprinc.name)
- finally:
- self._lock.release()
+
+ conn = ipaserver.ipaldap.IPAdmin(host,port,None,None,None,debug)
+
+ # This will bind the connection
+ conn.set_krbccache(krbccache, cprinc.name)
return conn
@@ -88,31 +83,7 @@ class IPAConnPool:
if conn is None:
return
- cprinc = conn.principal
-
- self._lock.acquire()
- try:
-
- # Look to see if we are already on the list from another source and
- # if so, remove it.
- try:
- c = self._dict[cprinc]
- del self._dict[cprinc]
- self._lru.remove(cprinc)
- except KeyError:
- # Not in the list
- pass
-
- if self._maxsize and len(self._dict) > self._maxsize:
- princ = self._lru.pop(0)
- c = self._dict[princ]
- c.unbind_s()
- del self._dict[cprinc]
-
- self._lru.append(cprinc)
- self._dict[cprinc] = conn
- finally:
- self._lock.release()
+ conn.unbind_s()
class IPAServer: