[asterisk-commits] tilghman: branch 1.6.0 r114062 - in /branches/1.6.0: ./ res/res_config_ldap.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 11 09:56:12 CDT 2008


Author: tilghman
Date: Fri Apr 11 09:56:12 2008
New Revision: 114062

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114062
Log:
Merged revisions 114061 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r114061 | tilghman | 2008-04-11 09:54:22 -0500 (Fri, 11 Apr 2008) | 6 lines

Errors are all greater than 0
(closes issue #12422)
 Reported by: nito
 Patches: 
       res_config_ldap_result_check_patch.diff uploaded by nito (license 340)

........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_config_ldap.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_config_ldap.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_config_ldap.c?view=diff&rev=114062&r1=114061&r2=114062
==============================================================================
--- branches/1.6.0/res/res_config_ldap.c (original)
+++ branches/1.6.0/res/res_config_ldap.c Fri Apr 11 09:56:12 2008
@@ -552,7 +552,7 @@
 		do {
 			result = ldap_search_ext_s(ldapConn, dn, LDAP_SCOPE_BASE,
 					   "(objectclass=*)", NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT, &ldap_result);
-			if (result < 0 && is_ldap_connect_error(result)) {
+			if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
 				ast_log(LOG_WARNING,
 					"Failed to query database. Try %d/3\n",
 					tries + 1);
@@ -567,9 +567,9 @@
 						break;
 				}
 			}
-		} while (result < 0 && tries < 3 && is_ldap_connect_error(result));
-
-		if (result < 0) {
+		} while (result != LDAP_SUCCESS && tries < 3 && is_ldap_connect_error(result));
+
+		if (result != LDAP_SUCCESS) {
 			ast_log(LOG_WARNING,
 					"Failed to query database. Check debug for more info.\n");
 			ast_debug(2, "dn=%s\n", dn);
@@ -787,7 +787,7 @@
 		result = ldap_search_ext_s(ldapConn, clean_basedn,
 				  LDAP_SCOPE_SUBTREE, filter->str, NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
 				  &ldap_result);
-		if (result < 0 && is_ldap_connect_error(result)) {
+		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
 			ast_log(LOG_DEBUG, "Failed to query database. Try %d/10\n",
 				tries + 1);
 			if (++tries < 10) {
@@ -800,9 +800,9 @@
 					break;
 			}
 		}
-	} while (result < 0 && tries < 10 && is_ldap_connect_error(result));
-
-	if (result < 0) {
+	} while (result != LDAP_SUCCESS && tries < 10 && is_ldap_connect_error(result));
+
+	if (result != LDAP_SUCCESS) {
 		ast_log(LOG_WARNING, "Failed to query database. Check debug for more info.\n");
 		ast_log(LOG_WARNING, "Query: %s\n", filter->str);
 		ast_log(LOG_WARNING, "Query Failed because: %s\n", ldap_err2string(result));
@@ -1244,7 +1244,7 @@
 		result = ldap_search_ext_s(ldapConn, clean_basedn,
 				  LDAP_SCOPE_SUBTREE, filter->str, NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
 				  &ldap_result);
-		if (result < 0 && is_ldap_connect_error(result)) {
+		if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
 			ast_log(LOG_WARNING, "Failed to query database. Try %d/3\n",
 				tries + 1);
 			tries++;
@@ -1258,9 +1258,9 @@
 					break;
 			}
 		}
-	} while (result < 0 && tries < 3 && is_ldap_connect_error(result));
-
-	if (result < 0) {
+	} while (result != LDAP_SUCCESS && tries < 3 && is_ldap_connect_error(result));
+
+	if (result != LDAP_SUCCESS) {
 		ast_log(LOG_WARNING, "Failed to query directory. Check debug for more info.\n");
 		ast_log(LOG_WARNING, "Query: %s\n", filter->str);
 		ast_log(LOG_WARNING, "Query Failed because: %s\n",




More information about the asterisk-commits mailing list