def _authenticateUsernamePassword(self, dn, password):
"""
Open a secondary connection to the LDAP server and try binding to it
with the given credentials
@returns: True if the password is correct, False otherwise
@rtype: deferred C{bool}
@raises: L{LDAPConnectionError} if unable to connect.
"""
d = deferToThreadPool(
reactor, self.threadpool,
self._authenticateUsernamePassword_inThread, dn, password
)
qsize = self.threadpool._queue.qsize()
if qsize > 0:
self.log.error("LDAP thread pool overflowing: {qsize}", qsize=qsize)
self.poolStats["connection-thread-blocked"] += 1
return d
评论列表
文章目录