version 1.261, 2009/02/15 23:12:38
|
version 1.262, 2009/02/22 23:37:12
|
Line 1
|
Line 1
|
/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.260 2009/02/15 22:21:28 hyc Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.261 2009/02/15 23:12:38 hyc Exp $ */ |
/* syncprov.c - syncrepl provider */ |
/* syncprov.c - syncrepl provider */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
Line 1630 syncprov_op_response( Operation *op, Sla
|
Line 1630 syncprov_op_response( Operation *op, Sla
|
{ |
{ |
struct berval maxcsn; |
struct berval maxcsn; |
char cbuf[LDAP_LUTIL_CSNSTR_BUFSIZE]; |
char cbuf[LDAP_LUTIL_CSNSTR_BUFSIZE]; |
int do_check = 0, have_psearches, foundit; |
int do_check = 0, have_psearches, foundit, csn_changed = 0; |
|
|
/* Update our context CSN */ |
/* Update our context CSN */ |
cbuf[0] = '\0'; |
cbuf[0] = '\0'; |
Line 1662 syncprov_op_response( Operation *op, Sla
|
Line 1662 syncprov_op_response( Operation *op, Sla
|
if ( sid == si->si_sids[i] ) { |
if ( sid == si->si_sids[i] ) { |
if ( ber_bvcmp( &maxcsn, &si->si_ctxcsn[i] ) > 0 ) { |
if ( ber_bvcmp( &maxcsn, &si->si_ctxcsn[i] ) > 0 ) { |
ber_bvreplace( &si->si_ctxcsn[i], &maxcsn ); |
ber_bvreplace( &si->si_ctxcsn[i], &maxcsn ); |
|
csn_changed = 1; |
} |
} |
break; |
break; |
} |
} |
Line 1669 syncprov_op_response( Operation *op, Sla
|
Line 1670 syncprov_op_response( Operation *op, Sla
|
/* It's a new SID for us */ |
/* It's a new SID for us */ |
if ( i == si->si_numcsns ) { |
if ( i == si->si_numcsns ) { |
value_add_one( &si->si_ctxcsn, &maxcsn ); |
value_add_one( &si->si_ctxcsn, &maxcsn ); |
|
csn_changed = 1; |
si->si_numcsns++; |
si->si_numcsns++; |
si->si_sids = ch_realloc( si->si_sids, si->si_numcsns * |
si->si_sids = ch_realloc( si->si_sids, si->si_numcsns * |
sizeof(int)); |
sizeof(int)); |
Line 1710 syncprov_op_response( Operation *op, Sla
|
Line 1712 syncprov_op_response( Operation *op, Sla
|
ldap_pvt_thread_rdwr_runlock( &si->si_csn_rwlock ); |
ldap_pvt_thread_rdwr_runlock( &si->si_csn_rwlock ); |
} |
} |
|
|
/* only update consumer ctx if this is the greatest csn */ |
/* only update consumer ctx if this is a newer csn */ |
if ( bvmatch( &maxcsn, &op->o_csn )) { |
if ( csn_changed ) { |
opc->sctxcsn = maxcsn; |
opc->sctxcsn = maxcsn; |
} |
} |
|
|