From: Grégory Oestreicher Date: Wed, 14 Sep 2016 20:36:55 +0000 (+0200) Subject: Don't throw an exception in ldapWaitResult() X-Git-Tag: rec-4.1.0-alpha1~170^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4f4349bb0da1101331bc31b08f16eb1e56d6ac3;p=thirdparty%2Fpdns.git Don't throw an exception in ldapWaitResult() --- diff --git a/modules/ldapbackend/ldaputils.cc b/modules/ldapbackend/ldaputils.cc index 35ee0c36bc..08cb2c28f2 100644 --- a/modules/ldapbackend/ldaputils.cc +++ b/modules/ldapbackend/ldaputils.cc @@ -35,13 +35,8 @@ int ldapWaitResult( LDAP *conn, int msgid, int timeout, LDAPMessage** result ) int rc = ldap_result( conn, msgid, LDAP_MSG_ONE, &tv, &res ); - switch( rc ) - { - case -1: - throw LDAPException( "Error waiting for LDAP result: " + ldapGetError( conn, rc ) ); - case 0: - throw LDAPTimeout(); - } + if ( rc == -1 || rc == 0 ) + return rc; if( result == NULL ) { diff --git a/modules/ldapbackend/powerldap.cc b/modules/ldapbackend/powerldap.cc index 646c642a52..f91b5de68e 100644 --- a/modules/ldapbackend/powerldap.cc +++ b/modules/ldapbackend/powerldap.cc @@ -173,13 +173,7 @@ int PowerLDAP::search( const string& base, int scope, const string& filter, cons int PowerLDAP::waitResult( int msgid, int timeout, LDAPMessage** result ) { - try { - return ldapWaitResult( d_ld, msgid, timeout, result ); - } - catch ( LDAPException &e ) { - ensureConnect(); - throw; // Not sure why this was done, but the original behavior. - } + return ldapWaitResult( d_ld, msgid, timeout, result ); }