]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Don't throw an exception in ldapWaitResult()
authorGrégory Oestreicher <greg@kamago.net>
Wed, 14 Sep 2016 20:36:55 +0000 (22:36 +0200)
committerGrégory Oestreicher <greg@kamago.net>
Tue, 28 Feb 2017 21:34:29 +0000 (22:34 +0100)
modules/ldapbackend/ldaputils.cc
modules/ldapbackend/powerldap.cc

index 35ee0c36bc50ed4ad7598fcf2336e056b203e0f2..08cb2c28f249915eb75403f829db52511c728f27 100644 (file)
@@ -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 )
        {
index 646c642a52b098dc428dd53af6aecdb8bcb65b01..f91b5de68ef93acf592183fededf492e563003f6 100644 (file)
@@ -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 );
 }