[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tpop3d-discuss] tpop3d v1.4.1pre4
From: |
Prune |
Subject: |
Re: [tpop3d-discuss] tpop3d v1.4.1pre4 |
Date: |
Mon, 25 Feb 2002 12:00:32 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 |
Also, as I said earlier, this part has a bug :
/* Try to bind to the LDAP server, reconnecting if it's gone away. */
for (i = 0; i < 3; ++i) {
if (ldapinfo.ldap && (ret = ldap_simple_bind_s(ldapinfo.ldap,
ldapinfo.searchdn, ldapinfo.password)) != LDAP_SUCCESS) {
log_print(LOG_ERR, "auth_ldap_new_user_pass:
ldap_simple_bind_s: %s", ldap_err2string(ret));
ldap_unbind(ldapinfo.ldap); /* not much we can do if this
fails.... */
ldapinfo.ldap = NULL;
}
if (!ldapinfo.ldap)
auth_ldap_connect();
}
It ALWAYS bind 3 times (if no error)!
but it should bind only one time in case of success.
This is just in case tpop3d disconnect from the ldap server, it tries 3
times for reconnect and bind.
When the connection is still valid, it actually bind 3 times...
maybe we could change this to :
/* Try to bind to the LDAP server, reconnecting if it's gone away. */
for (i = 0; i < 3; ++i) {
if (ldapinfo.ldap && (ret = ldap_simple_bind_s(ldapinfo.ldap,
ldapinfo.searchdn, ldapinfo.password)) != LDAP_SUCCESS) {
log_print(LOG_ERR, "auth_ldap_new_user_pass:
ldap_simple_bind_s: %s", ldap_err2string(ret));
ldap_unbind(ldapinfo.ldap); /* not much we can do if this
fails.... */
ldapinfo.ldap = NULL;
}
else break;
if (!ldapinfo.ldap)
auth_ldap_connect();
}
-
Prune
Re: [tpop3d-discuss] tpop3d v1.4.1pre4, Prune, 2002/02/25
Re: [tpop3d-discuss] tpop3d v1.4.1pre4,
Prune <=
Re: [tpop3d-discuss] tpop3d v1.4.1pre4, Prune, 2002/02/25
RE: [tpop3d-discuss] tpop3d v1.4.1pre4, Michael Klatsky, 2002/02/25
RE: [tpop3d-discuss] tpop3d v1.4.1pre4, Michael Klatsky, 2002/02/25
Re: [tpop3d-discuss] tpop3d v1.4.1pre4, Prune, 2002/02/25
RE: [tpop3d-discuss] tpop3d v1.4.1pre4, Michael Klatsky, 2002/02/25