]> git.sur5r.net Git - openldap/commitdiff
Moved unbind processing into connection_destroy. unbind handler is not needed.
authorHoward Chu <hyc@openldap.org>
Sun, 25 Jul 1999 22:16:01 +0000 (22:16 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 25 Jul 1999 22:16:01 +0000 (22:16 +0000)
servers/slapd/back-ldap/external.h
servers/slapd/back-ldap/init.c
servers/slapd/back-ldap/unbind.c

index d71238c54f8b939dbdc3dd6802cdfb9071db3fb8..8d90ee4d007d1c63756dfd8fe6e3f2859baf0dcf 100644 (file)
@@ -19,8 +19,8 @@ extern int ldap_back_bind LDAP_P(( BackendDB *bd,
        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,
index 5367bc1e4b328a32d153a81c24bc9eb641a1d619..63cbf896a32b9db0b1a7e55dac51760cb6f053fb 100644 (file)
@@ -61,7 +61,7 @@ ldap_back_initialize(
        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;
@@ -73,7 +73,7 @@ ldap_back_initialize(
        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;
 }
index 8f1a5f3c78b8676978acc13e4ad0c8258f024aa3..09075aa69d593d1d922fafe0ac0ffc9bfb613179 100644 (file)
 #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);
        }