From 8848dd83dc111f3a1d1236fd173bd031663ba949 Mon Sep 17 00:00:00 2001 From: Wilbur Wang Date: Fri, 4 Aug 2017 18:32:47 +0800 Subject: [PATCH] use bind_s to avoid ldap server busy Using bind_s will serialize the interactions with ldap server. Otherwise it may fail with error like this: {'info': '00002024: LdapErr: DSID-0C060595, comment: No other operations may be performed on the connection while a bind is outstanding., data 0, v1772', 'desc': 'Server is busy'} --- mutt_ldap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mutt_ldap.py b/mutt_ldap.py index c63c04e..c9cec4d 100755 --- a/mutt_ldap.py +++ b/mutt_ldap.py @@ -195,7 +195,7 @@ def connect(self): sasl = _ldap_sasl.gssapi() self.connection.sasl_interactive_bind_s('', sasl) else: - self.connection.bind( + self.connection.bind_s( self.config.get('auth', 'user'), self.config.get('auth', 'password'), _ldap.AUTH_SIMPLE)