Index: squid_ldap_auth.c =================================================================== RCS file: /server/cvs-server/squid/squid/helpers/basic_auth/LDAP/squid_ldap_auth.c,v --- squid_ldap_auth.c 21 Jul 2004 21:05:29 -0000 1.21.2.12 +++ squid_ldap_auth.c 27 Jul 2004 21:22:43 -0000 @@ -197,6 +197,12 @@ squid_ldap_memfree(char *p) #endif +#ifdef LDAP_API_FEATURE_X_OPENLDAP +#if LDAP_VENDOR_VERSION > 194 +#define HAS_URI_SUPPORT 1 +#endif +#endif + static LDAP * open_ldap_connection(const char *ldapServer, int port) { @@ -206,7 +212,7 @@ open_ldap_connection(const char *ldapSer int rc = ldap_initialize(&ld, ldapServer); if (rc != LDAP_SUCCESS) { fprintf(stderr, "\nUnable to connect to LDAPURI:%s\n", ldapServer); - break; + exit(1); } } else #endif @@ -255,12 +261,6 @@ open_ldap_connection(const char *ldapSer return ld; } -#ifdef LDAP_API_FEATURE_X_OPENLDAP -#if LDAP_VENDOR_VERSION > 194 -#define HAS_URI_SUPPORT 1 -#endif -#endif - int main(int argc, char **argv) { @@ -479,7 +479,7 @@ main(int argc, char **argv) } rfc1738_unescape(user); rfc1738_unescape(passwd); - tryagain = 1; + tryagain = (ld != NULL); recover: if (ld == NULL && persistent) ld = open_ldap_connection(ldapServer, port); @@ -637,7 +637,7 @@ checkLDAP(LDAP * persistent_ld, const ch ldap_unbind(bind_ld); bind_ld = NULL; } - return 0; + return ret; } int