char *dn, int method, char* mech,
struct berval *cred, char** edn ));
-extern int ldap_back_unbind LDAP_P(( BackendDB *bd,
- Connection *conn, Operation *op ));
+extern int ldap_back_conn_destroy LDAP_P(( BackendDB *bd,
+ Connection *conn ));
extern int ldap_back_search LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
bi->bi_db_destroy = ldap_back_db_destroy;
bi->bi_op_bind = ldap_back_bind;
- bi->bi_op_unbind = ldap_back_unbind;
+ bi->bi_op_unbind = 0;
bi->bi_op_search = ldap_back_search;
bi->bi_op_compare = ldap_back_compare;
bi->bi_op_modify = ldap_back_modify;
bi->bi_acl_group = 0;
bi->bi_connection_init = 0;
- bi->bi_connection_destroy = 0;
+ bi->bi_connection_destroy = ldap_back_conn_destroy;
return 0;
}
#include "back-ldap.h"
int
-ldap_back_unbind(
+ldap_back_conn_destroy(
Backend *be,
- Connection *conn,
- Operation *op
+ Connection *conn
)
{
struct ldapinfo *li = (struct ldapinfo *) be->be_private;
struct ldapconn *lc, *lp;
+ ldap_pvt_thread_mutex_lock( &li->conn_mutex );
for (lc = li->lcs, lp = (struct ldapconn *)&li->lcs; lc;
lp=lc, lc=lc->next)
- if (lc->conn == conn)
+ if (lc->conn == conn) {
+ lp->next = lc->next;
break;
+ }
+ ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
if (lc) {
if (lc->bound)
ldap_unbind(lc->ld);
- lp->next = lc->next;
free(lc);
}