]> git.sur5r.net Git - openldap/commitdiff
Delete unused be_context_csn, cleanup pending csn entry
authorHoward Chu <hyc@openldap.org>
Mon, 6 Dec 2004 23:17:58 +0000 (23:17 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 6 Dec 2004 23:17:58 +0000 (23:17 +0000)
servers/slapd/backend.c
servers/slapd/ctxcsn.c
servers/slapd/slap.h

index 322f4c6f48e41b77fe4cad23ec9e70d85326869f..d04e0041a8b33a4dd10e4b5306f795a55666936f 100644 (file)
@@ -183,8 +183,6 @@ int backend_startup_one(Backend *be)
 
        be->be_pending_csn_list = (struct be_pcl *)
                ch_calloc( 1, sizeof( struct be_pcl ));
-       build_new_dn( &be->be_context_csn, be->be_nsuffix,
-               (struct berval *)&slap_ldapsync_cn_bv, NULL );
 
        LDAP_TAILQ_INIT( be->be_pending_csn_list );
 
@@ -406,8 +404,7 @@ int backend_destroy(void)
                                struct slap_csn_entry *tmp_csne = csne;
 
                                LDAP_TAILQ_REMOVE( bd->be_pending_csn_list, csne, ce_csn_link );
-                               ch_free( csne->ce_csn->bv_val );
-                               ch_free( csne->ce_csn );
+                               ch_free( csne->ce_csn.bv_val );
                                csne = LDAP_TAILQ_NEXT( csne, ce_csn_link );
                                ch_free( tmp_csne );
                        }
@@ -421,7 +418,6 @@ int backend_destroy(void)
                if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
                if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
                if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
-               if ( bd->be_context_csn.bv_val ) free( bd->be_context_csn.bv_val );
                acl_destroy( bd->be_acl, frontendDB->be_acl );
        }
        free( backendDB );
@@ -514,8 +510,6 @@ backend_db_init(
        be->be_requires = frontendDB->be_requires;
        be->be_ssf_set = frontendDB->be_ssf_set;
 
-       be->be_context_csn.bv_len = 0;
-       be->be_context_csn.bv_val = NULL;
        be->be_pcl_mutexp = &be->be_pcl_mutex;
        ldap_pvt_thread_mutex_init( be->be_pcl_mutexp );
 
index 340f21db4b0e975fef2f2cdc9648e6f27eb7c8f8..9cb08328fd041a0d976676d3407546f13b9fd3db 100644 (file)
@@ -52,7 +52,7 @@ slap_get_commit_csn( Operation *op, struct berval *csn )
                if ( csne->ce_state == SLAP_CSN_PENDING ) break;
        }
 
-       if ( committed_csne ) ber_dupbv_x( csn, committed_csne->ce_csn, op->o_tmpmemctx );
+       if ( committed_csne ) ber_dupbv_x( csn, &committed_csne->ce_csn, op->o_tmpmemctx );
        ldap_pvt_thread_mutex_unlock( op->o_bd->be_pcl_mutexp );
 }
 
@@ -87,8 +87,7 @@ slap_graduate_commit_csn( Operation *op )
                if ( csne->ce_opid == op->o_opid && csne->ce_connid == op->o_connid ) {
                        LDAP_TAILQ_REMOVE( op->o_bd->be_pending_csn_list,
                                csne, ce_csn_link );
-                       ch_free( csne->ce_csn->bv_val );
-                       ch_free( csne->ce_csn );
+                       ch_free( csne->ce_csn.bv_val );
                        ch_free( csne );
                        break;
                }
@@ -151,7 +150,7 @@ slap_queue_csn(
                        sizeof( struct slap_csn_entry ));
        ldap_pvt_thread_mutex_lock( op->o_bd->be_pcl_mutexp );
 
-       pending->ce_csn = ber_dupbv( NULL, csn );
+       ber_dupbv( &pending->ce_csn, csn );
        pending->ce_connid = op->o_connid;
        pending->ce_opid = op->o_opid;
        pending->ce_state = SLAP_CSN_PENDING;
index 3b917b1e63fe46a504a82d7bfeab150ba9c845da..43382079322664f6e9e30f5d23e421cd95bec417 100644 (file)
@@ -1668,7 +1668,6 @@ struct slap_backend_db {
        struct          be_pcl  *be_pending_csn_list;
        ldap_pvt_thread_mutex_t                                 be_pcl_mutex;
        ldap_pvt_thread_mutex_t                                 *be_pcl_mutexp;
-       struct berval                                                   be_context_csn;
        LDAP_STAILQ_HEAD( be_si, syncinfo_s )   be_syncinfo; /* For syncrepl */
 
        char    *be_realm;
@@ -2086,7 +2085,7 @@ struct slap_session_entry {
 };
 
 struct slap_csn_entry {
-       struct berval *ce_csn;
+       struct berval ce_csn;
        unsigned long ce_opid;
        unsigned long ce_connid;
 #define SLAP_CSN_PENDING       1