summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-05-02 19:32:03 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2008-05-02 19:32:03 +0000
commitdd79b47f8806b4fd850ec9ba013128c0461f7617 (patch)
tree83b954f57684e2de4e173385f280dc5df42902a5 /include
parent3aeceaffc87f4e7ac5a5a93829414801c0efeb8e (diff)
downloadlibapr-util-dd79b47f8806b4fd850ec9ba013128c0461f7617.tar.gz
Wrapper for LDAP_SERVER_DOWN. where LDAP_UNAVAILABLE might occur instead.
PR: 43875 Submitted by: Eric Covener <covener gmail.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@652876 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include')
-rw-r--r--include/apr_ldap.h.in2
-rw-r--r--include/apr_ldap.hnw2
-rw-r--r--include/apr_ldap.hw12
3 files changed, 16 insertions, 0 deletions
diff --git a/include/apr_ldap.h.in b/include/apr_ldap.h.in
index 03156418..c38fb79a 100644
--- a/include/apr_ldap.h.in
+++ b/include/apr_ldap.h.in
@@ -151,6 +151,8 @@ typedef struct apr_ldap_err_t {
}
#endif
+#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN)
+
#include "apr_ldap_url.h"
#include "apr_ldap_init.h"
#include "apr_ldap_option.h"
diff --git a/include/apr_ldap.hnw b/include/apr_ldap.hnw
index d11b0139..21c30a56 100644
--- a/include/apr_ldap.hnw
+++ b/include/apr_ldap.hnw
@@ -124,6 +124,8 @@ typedef struct apr_ldap_err_t {
}
#endif
+#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN)
+
#include "apr_ldap_url.h"
#include "apr_ldap_init.h"
#include "apr_ldap_option.h"
diff --git a/include/apr_ldap.hw b/include/apr_ldap.hw
index 57b11639..72694ff0 100644
--- a/include/apr_ldap.hw
+++ b/include/apr_ldap.hw
@@ -122,6 +122,18 @@ typedef struct apr_ldap_err_t {
}
#endif
+/* The MS SDK returns LDAP_UNAVAILABLE when the backend has closed the connection
+ * between LDAP calls. Protect with APR_HAS_MICROSOFT_LDAPSDK in case someone
+ * manually chooses another SDK on Windows
+ */
+
+#if APR_HAS_MICROSOFT_LDAPSDK
+#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN \
+ ||(s) == LDAP_UNAVAILABLE)
+#else
+#define APR_LDAP_IS_SERVER_DOWN(s) ((s) == LDAP_SERVER_DOWN)
+#endif
+
#include "apr_ldap_url.h"
#include "apr_ldap_init.h"
#include "apr_ldap_option.h"