diff options
-rw-r--r-- | include/apr_ldap.h.in | 2 | ||||
-rw-r--r-- | include/apr_ldap.hnw | 2 | ||||
-rw-r--r-- | include/apr_ldap.hw | 12 |
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" |