]> git.sur5r.net Git - openldap/commitdiff
treat TRUE/FLASE like SUCCESS; don't chase "" referrals
authorPierangelo Masarati <ando@openldap.org>
Mon, 22 Aug 2005 09:41:36 +0000 (09:41 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 22 Aug 2005 09:41:36 +0000 (09:41 +0000)
libraries/libldap/result.c

index be0de7ab0f4eb84764e19314832157cb20bd656e..a4f1093bbe37b2e253cf690582a84e5edee6fa42 100644 (file)
@@ -660,15 +660,31 @@ nextresp2:
                                        } else {
                                                lr->lr_res_error = lr_res_error;
                                        }
+                                       lr_res_error = NULL;
                                }
 
-                               if ( lderr != LDAP_SUCCESS ) {
+                               switch ( lderr ) {
+                               case LDAP_SUCCESS:
+                               case LDAP_COMPARE_TRUE:
+                               case LDAP_COMPARE_FALSE:
+                                       break;
+
+                               default:
+                                       if ( lr->lr_res_error == NULL
+                                               || lr->lr_res_error[ 0 ] == '\0' )
+                                       {
+                                               break;
+                                       }
+
                                        /* referrals are in error string */
                                        refer_cnt = ldap_chase_referrals( ld, lr,
                                                &lr->lr_res_error, -1, &hadref );
                                        lr->lr_status = LDAP_REQST_COMPLETED;
                                        Debug( LDAP_DEBUG_TRACE,
-                                           "read1msg:  V2 referral chased, mark request completed, id = %d\n", lr->lr_msgid, 0, 0);
+                                               "read1msg:  V2 referral chased, "
+                                               "mark request completed, id = %d\n",
+                                               lr->lr_msgid, 0, 0 );
+                                       break;
                                }
 
                                /* save errno, message, and matched string */