mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
use macros for fake connid
This commit is contained in:
parent
4105ee462d
commit
39f0d79485
@ -762,7 +762,7 @@ be_shadow_update( Operation *op )
|
||||
/* This assumes that all internal ops (connid <= -1000) on a syncrepl
|
||||
* database are syncrepl operations.
|
||||
*/
|
||||
return (( SLAP_SYNC_SHADOW( op->o_bd ) && op->o_connid <= -1000 ) ||
|
||||
return ( ( SLAP_SYNC_SHADOW( op->o_bd ) && SLAPD_SYNC_IS_SYNCCONN( op->o_connid ) ) ||
|
||||
( SLAP_SHADOW( op->o_bd ) && be_isupdate_dn( op->o_bd, &op->o_ndn ) ) );
|
||||
}
|
||||
|
||||
|
@ -1701,6 +1701,11 @@ typedef BackendDB Backend;
|
||||
|
||||
struct syncinfo_s;
|
||||
|
||||
/* fake conn connid constructed as SLAPD_SYNC_CONN_OFFSET - rid */
|
||||
#define SLAPD_SYNC_SYNCCONN_OFFSET (-1000)
|
||||
#define SLAPD_SYNC_IS_SYNCCONN(connid) ((connid) <= SLAPD_SYNC_SYNCCONN_OFFSET)
|
||||
#define SLAPD_SYNC_RID2SYNCCONN(rid) (SLAPD_SYNC_SYNCCONN_OFFSET - (rid))
|
||||
|
||||
#define SLAP_SYNC_RID_MAX 999
|
||||
#define SLAP_SYNC_SID_MAX 4095 /* based on liblutil/csn.c field width */
|
||||
#define SLAP_SYNCUUID_SET_SIZE 256
|
||||
|
@ -1354,7 +1354,7 @@ do_syncrepl(
|
||||
connection_fake_init( &conn, &opbuf, ctx );
|
||||
op = &opbuf.ob_op;
|
||||
/* o_connids must be unique for slap_graduate_commit_csn */
|
||||
op->o_connid = -1000 - si->si_rid;
|
||||
op->o_connid = SLAPD_SYNC_RID2SYNCCONN(si->si_rid);
|
||||
|
||||
op->o_managedsait = SLAP_CONTROL_NONCRITICAL;
|
||||
be = si->si_be;
|
||||
|
Loading…
Reference in New Issue
Block a user