use macros for fake connid

This commit is contained in:
Pierangelo Masarati 2009-11-21 21:02:49 +00:00
parent 4105ee462d
commit 39f0d79485
3 changed files with 7 additions and 2 deletions

View File

@ -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 ) ) );
}

View File

@ -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

View File

@ -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;