]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/accesslog.c
Merge remote branch 'origin/mdb.master' into OPENLDAP_REL_ENG_2_4
[openldap] / servers / slapd / overlays / accesslog.c
index bc5b7b6e57a9809d48a4e63f04cca905de998f2d..7d8cf7314945571230bb7bc1cf5fefecdcfd973b 100644 (file)
@@ -1457,7 +1457,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
        Modifications *m;
        struct berval *b, uuid = BER_BVNULL;
        int i;
-       int logop;
+       int logop, do_graduate = 0;
        slap_verbmasks *lo;
        Entry *e = NULL, *old = NULL, *e_uuid = NULL;
        char timebuf[LDAP_LUTIL_GENTIME_BUFSIZE+8];
@@ -1795,7 +1795,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
        }
 
        if ( e_uuid || !BER_BVISNULL( &uuid ) ) {
-               struct berval *pbv;
+               struct berval *pbv = NULL;
 
                if ( !BER_BVISNULL( &uuid ) ) {
                        pbv = &uuid;
@@ -1829,11 +1829,17 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
 
        if (( lo->mask & LOG_OP_WRITES ) && !BER_BVISEMPTY( &op->o_csn )) {
                slap_queue_csn( &op2, &op->o_csn );
+               do_graduate = 1;
        }
 
        op2.o_bd->be_add( &op2, &rs2 );
        if ( e == op2.ora_e ) entry_free( e );
        e = NULL;
+       if ( do_graduate ) {
+               slap_graduate_commit_csn( &op2 );
+               if ( op2.o_csn.bv_val )
+                       op->o_tmpfree( op2.o_csn.bv_val, op->o_tmpmemctx );
+       }
 
 done:
        if ( lo->mask & LOG_OP_WRITES )