From: Howard Chu Date: Sat, 9 Apr 2005 11:26:31 +0000 (+0000) Subject: Don't do ctxcsn checks in Tool mode, don't generate ctxcsn if it's missing X-Git-Tag: OPENLDAP_AC_BP~946 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=335e8a8ba7f8b74ee6a0b6cf97ef07ebdf13e38e;p=openldap Don't do ctxcsn checks in Tool mode, don't generate ctxcsn if it's missing and we're also a consumer. --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 05b6606ad1..721dc15b8d 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -2057,6 +2057,10 @@ syncprov_db_open( Attribute *a; int rc; + if ( slapMode & SLAP_TOOL_MODE ) { + return 0; + } + rc = overlay_register_control( be, LDAP_CONTROL_SYNC ); if ( rc ) { return rc; @@ -2090,6 +2094,12 @@ syncprov_db_open( op->o_req_ndn = be->be_nsuffix[0]; op->ors_scope = LDAP_SCOPE_SUBTREE; syncprov_findcsn( op, FIND_MAXCSN ); + } else if ( SLAP_SYNC_SHADOW( op->o_bd )) { + /* If we're also a consumer, and we didn't find the context entry, + * then don't generate anything, wait for our provider to send it + * to us. + */ + goto out; } if ( BER_BVISEMPTY( &si->si_ctxcsn ) ) { @@ -2105,6 +2115,7 @@ syncprov_db_open( syncprov_checkpoint( op, &rs, on ); } +out: op->o_bd->bd_info = (BackendInfo *)on; return 0; } @@ -2120,6 +2131,9 @@ syncprov_db_close( syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private; int i; + if ( slapMode & SLAP_TOOL_MODE ) { + return 0; + } if ( si->si_numops ) { Connection conn; char opbuf[OPERATION_BUFFER_SIZE];