]> git.sur5r.net Git - openldap/commitdiff
implement hook; cleanup
authorPierangelo Masarati <ando@openldap.org>
Sun, 30 Jan 2005 22:05:46 +0000 (22:05 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 30 Jan 2005 22:05:46 +0000 (22:05 +0000)
servers/slapd/back-ldap/chain.c
servers/slapd/back-ldap/search.c

index d481abb7a486707060f8b820c0896d517adeec95..7dcb95f29fc1d36a5c1c76e6fc8b8910d4f01bf1 100644 (file)
@@ -614,6 +614,23 @@ ldap_chain_db_destroy(
        return rc;
 }
 
+static int
+ldap_chain_connection_destroy(
+       BackendDB *be,
+       Connection *conn
+)
+{
+       slap_overinst *on = (slap_overinst *) be->bd_info;
+       void *private = be->be_private;
+       int rc;
+
+       be->be_private = on->on_bi.bi_private;
+       rc = lback->bi_connection_destroy( be, conn );
+       on->on_bi.bi_private = be->be_private;
+       be->be_private = private;
+       return rc;
+}
+
 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
 static int
 ldap_chain_parse_ctrl(
@@ -766,18 +783,20 @@ chain_init( void )
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
        ldapchain.on_bi.bi_db_config = ldap_chain_db_config;
        ldapchain.on_bi.bi_db_destroy = ldap_chain_db_destroy;
-       
+
        /* ... otherwise the underlying backend's function would be called,
         * likely passing an invalid entry; on the contrary, the requested
         * operational attributes should have been returned while chasing
         * the referrals.  This all in all is a bit messy, because part
-        * of the operational attributes are generated by they backend;
+        * of the operational attributes are generated by the backend;
         * part by the frontend; back-ldap should receive all the available
-        * ones from the remote server, but then, on it own, it strips those
+        * ones from the remote server, but then, on its own, it strips those
         * it assumes will be (re)generated by the frontend (e.g.
         * subschemaSubentry.) */
        ldapchain.on_bi.bi_operational = ldap_chain_operational;
        
+       ldapchain.on_bi.bi_connection_destroy = ldap_chain_connection_destroy;
+
        ldapchain.on_response = ldap_chain_response;
 
        return overlay_register( &ldapchain );
index cd84f8dcda2be003f328acfe53f3e26170b9609d..8c610a57980b1c18b1006a4c2a060a51f58a5f17 100644 (file)
@@ -573,8 +573,8 @@ ldap_back_entry_get(
        
 retry:
        rc = ldap_search_ext_s( lc->lc_ld, ndn->bv_val, LDAP_SCOPE_BASE, filter,
-                               at ? gattr : NULL, 0, ctrls, NULL, LDAP_NO_LIMIT,
-                               LDAP_NO_LIMIT, &result );
+                               at ? gattr : NULL, 0, ctrls, NULL,
+                               LDAP_NO_LIMIT, LDAP_NO_LIMIT, &result );
        if ( rc != LDAP_SUCCESS ) {
                if ( rc == LDAP_SERVER_DOWN && do_retry ) {
                        do_retry = 0;