Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory
cvs-int.fedora.redhat.com:/tmp/cvs-serv25950/ldap/servers/plugins/replication
Modified Files:
cl5_api.c cl5_config.c repl5_connection.c repl5_inc_protocol.c
repl5_plugins.c repl5_replica.c repl5_total.c repl_controls.c
repl_extop.c repl_monitor.c replutil.c windows_connection.c
windows_inc_protocol.c windows_private.c
windows_protocol_util.c windows_tot_protocol.c
Log Message:
Resolves: #188320
Summary: HP-UX: warnings reported by the HP-UX compiler
Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- cl5_api.c 16 Oct 2007 21:22:47 -0000 1.18
+++ cl5_api.c 18 Oct 2007 00:08:31 -0000 1.19
@@ -348,7 +348,9 @@
static int _cl5WriteBervals (struct berval **bv, char** buff, unsigned int *size);
/* replay iteration */
+#ifdef FOR_DEBUGGING
static PRBool _cl5ValidReplayIterator (const CL5ReplayIterator *iterator);
+#endif
static int _cl5PositionCursorForReplay (ReplicaId consumerRID, const RUV *consumerRuv,
Object *replica, Object *fileObject, CL5ReplayIterator **iterator);
static int _cl5CheckMissingCSN (const CSN *minCsn, const RUV *supplierRUV, CL5DBFile
*file);
@@ -3766,7 +3768,6 @@
/* must be called under the state lock */
static void _cl5Close ()
{
- int rc2 = 0;
PRIntervalTime interval;
if (s_cl5Desc.dbState != CL5_STATE_CLOSED) /* Don't try to close twice */
@@ -3792,7 +3793,7 @@
if (s_cl5Desc.dbEnv)
{
DB_ENV *dbEnv = s_cl5Desc.dbEnv;
- rc2 = dbEnv->close(dbEnv, 0);
+ dbEnv->close(dbEnv, 0);
s_cl5Desc.dbEnv = NULL;
}
@@ -5596,6 +5597,7 @@
return retval;
}
+#ifdef FOR_DEBUGGING
/* Replay iteration helper functions */
static PRBool _cl5ValidReplayIterator (const CL5ReplayIterator *iterator)
{
@@ -5606,6 +5608,7 @@
return PR_TRUE;
}
+#endif
/* Algorithm: ONREPL!!!
*/
@@ -5628,7 +5631,6 @@
int rc = CL5_SUCCESS;
Object *supplierRuvObj = NULL;
RUV *supplierRuv = NULL;
- ReplicaId supplierRID;
PRBool newReplica;
PRBool haveChanges = PR_FALSE;
char *agmt_name;
@@ -5638,7 +5640,6 @@
csnStr[0] = '\0';
file = (CL5DBFile*)object_get_data (fileObj);
- supplierRID = replica_get_rid((Replica*)object_get_data(replica));
/* get supplier's RUV */
supplierRuvObj = replica_get_ruv((Replica*)object_get_data(replica));
Index: cl5_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_config.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cl5_config.c 16 Oct 2007 21:22:47 -0000 1.7
+++ cl5_config.c 18 Oct 2007 00:08:31 -0000 1.8
@@ -330,7 +330,7 @@
slapi_ch_free_string(&config.maxAge);
config.maxAge = slapi_ch_strdup(CL5_STR_IGNORE);
config.dbconfig.maxChCacheEntries = 0;
- config.dbconfig.maxChCacheSize = CL5_NUM_IGNORE;
+ config.dbconfig.maxChCacheSize = (PRUint32)CL5_NUM_IGNORE;
slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
for (i = 0; mods[i] != NULL; i++)
@@ -438,7 +438,7 @@
}
if (config.dbconfig.maxChCacheEntries == 0)
config.dbconfig.maxChCacheEntries = originalConfig->dbconfig.maxChCacheEntries;
- if (config.dbconfig.maxChCacheSize == CL5_NUM_IGNORE)
+ if (config.dbconfig.maxChCacheSize == (PRUint32)CL5_NUM_IGNORE)
config.dbconfig.maxChCacheSize = originalConfig->dbconfig.maxChCacheSize;
@@ -567,7 +567,7 @@
}
}
- if (config.dbconfig.maxChCacheEntries != 0 || config.dbconfig.maxChCacheSize !=
CL5_NUM_IGNORE)
+ if (config.dbconfig.maxChCacheEntries != 0 || config.dbconfig.maxChCacheSize !=
(PRUint32)CL5_NUM_IGNORE)
clcache_set_config(&config.dbconfig);
done:;
Index: repl5_connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_connection.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- repl5_connection.c 10 Nov 2006 23:45:17 -0000 1.7
+++ repl5_connection.c 18 Oct 2007 00:08:31 -0000 1.8
@@ -471,7 +471,6 @@
LDAPControl *server_controls[3];
/* LDAPControl **loc_returned_controls; */
const char *op_string = NULL;
- const char *extra_op_string = NULL;
int msgid = 0;
server_controls[0] = &manageDSAITControl;
@@ -562,7 +561,6 @@
case CONN_EXTENDED_OPERATION:
conn->status = STATUS_PROCESSING_EXTENDED_OPERATION;
op_string = "extended";
- extra_op_string = extop_oid;
rc = ldap_extended_operation(conn->ld, extop_oid, extop_payload,
server_controls, NULL /* clientctls */, &msgid);
}
@@ -864,7 +862,6 @@
ConnResult
conn_connect(Repl_Connection *conn)
{
- int ldap_rc;
int optdata;
int secure = 0;
char* binddn = NULL;
@@ -1012,7 +1009,7 @@
}
else
{
- conn->last_ldap_error = ldap_rc = LDAP_SUCCESS;
+ conn->last_ldap_error = LDAP_SUCCESS;
conn->state = STATE_CONNECTED;
return_value = CONN_OPERATION_SUCCESS;
}
@@ -1028,7 +1025,7 @@
close_connection_internal(conn);
} else
{
- conn->last_ldap_error = ldap_rc = LDAP_SUCCESS;
+ conn->last_ldap_error = LDAP_SUCCESS;
conn->state = STATE_CONNECTED;
}
@@ -1698,6 +1695,7 @@
}
}
+#ifdef FOR_DEBUGGING
static time_t
PRTime2time_t (PRTime tm)
{
@@ -1709,6 +1707,7 @@
return (time_t)rt;
}
+#endif
static Slapi_Eq_Context
repl5_start_debug_timeout(int *setlevel)
Index: repl5_inc_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_inc_protocol.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- repl5_inc_protocol.c 10 Nov 2006 23:45:17 -0000 1.10
+++ repl5_inc_protocol.c 18 Oct 2007 00:08:31 -0000 1.11
@@ -598,8 +598,6 @@
int wait_change_timer_set = 0;
time_t last_start_time;
PRUint32 num_changes_sent;
- char *hostname = NULL;
- int portnum = 0;
/* use a different backoff timer strategy for ACQUIRE_REPLICA_BUSY errors */
PRBool use_busy_backoff_timer = PR_FALSE;
long pausetime = 0;
@@ -607,8 +605,6 @@
prp->stopped = 0;
prp->terminate = 0;
- hostname = agmt_get_hostname(prp->agmt);
- portnum = agmt_get_port(prp->agmt);
/* establish_protocol_callbacks(prp); */
done = 0;
@@ -1264,7 +1260,6 @@
current_state = next_state;
} while (!done);
- slapi_ch_free((void**)&hostname);
/* remove_protocol_callbacks(prp); */
prp->stopped = 1;
/* Cancel any linger timer that might be in effect... */
Index: repl5_plugins.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_plugins.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- repl5_plugins.c 12 Sep 2007 00:59:53 -0000 1.8
+++ repl5_plugins.c 18 Oct 2007 00:08:31 -0000 1.9
@@ -86,7 +86,6 @@
static PRBool process_operation (Slapi_PBlock *pb, const CSN *csn);
static PRBool is_mmr_replica (Slapi_PBlock *pb);
static const char *replica_get_purl_for_op (const Replica *r, Slapi_PBlock *pb, const CSN
*opcsn);
-static void strip_legacy_info (slapi_operation_parameters *op_params);
/*
* XXXggood - what to do if both ssl and non-ssl ports available? How
@@ -695,12 +694,10 @@
Slapi_Operation *op;
int is_replicated_operation;
int is_fixup_operation;
- int is_legacy_operation;
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
- is_legacy_operation= operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
/* For replicated operations, apply URP algorithm */
if (is_replicated_operation && !is_fixup_operation)
@@ -718,12 +715,10 @@
Slapi_Operation *op;
int is_replicated_operation;
int is_fixup_operation;
- int is_legacy_operation;
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
- is_legacy_operation= operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
/* For replicated operations, apply URP algorithm */
if(is_replicated_operation && !is_fixup_operation)
@@ -741,12 +736,10 @@
Slapi_Operation *op;
int is_replicated_operation;
int is_fixup_operation;
- int is_legacy_operation;
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
- is_legacy_operation= operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
/* For replicated operations, apply URP algorithm */
if(is_replicated_operation && !is_fixup_operation)
@@ -767,12 +760,10 @@
Slapi_Operation *op;
int is_replicated_operation;
int is_fixup_operation;
- int is_legacy_operation;
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
is_replicated_operation= operation_is_flag_set(op,OP_FLAG_REPLICATED);
is_fixup_operation= operation_is_flag_set(op,OP_FLAG_REPL_FIXUP);
- is_legacy_operation= operation_is_flag_set(op,OP_FLAG_LEGACY_REPLICATION_DN);
/* For replicated operations, apply URP algorithm */
if(is_replicated_operation && !is_fixup_operation)
@@ -1341,6 +1332,7 @@
return purl;
}
+#ifdef NOTUSED
/* ONREPL at the moment, I decided not to trim copiedFrom and copyingFrom
attributes when sending operation to replicas. This is because, each
operation results in a state information stored in the database and
@@ -1385,6 +1377,7 @@
default: break;
}
}
+#endif
/* this function is called when state of a backend changes */
void
@@ -1432,9 +1425,12 @@
object_release (r_obj);
}
+#ifdef NOTUSED
+/* Keeping the function just in case */
static void
close_changelog_for_replica (Object *r_obj)
{
if (cl5GetState () == CL5_STATE_OPEN)
cl5CloseDB (r_obj);
}
+#endif
Index: repl5_replica.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_replica.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- repl5_replica.c 10 Nov 2006 23:45:17 -0000 1.14
+++ repl5_replica.c 18 Oct 2007 00:08:31 -0000 1.15
@@ -3230,7 +3230,6 @@
char *current_purl = NULL;
char *p_locking_purl = NULL;
char *locking_purl = NULL;
- int junkrc;
ReplicaId junkrid;
PRBool isInc = PR_FALSE; /* get exclusive access, but not for inc update */
RUV *repl_ruv = NULL;
@@ -3255,7 +3254,7 @@
from a supplier
*/
repl_ruv = (RUV*) object_get_data (r->repl_ruv);
- junkrc = ruv_get_first_id_and_purl(repl_ruv, &junkrid, &p_locking_purl);
+ ruv_get_first_id_and_purl(repl_ruv, &junkrid, &p_locking_purl);
locking_purl = slapi_ch_strdup(p_locking_purl);
p_locking_purl = NULL;
repl_ruv = NULL;
Index: repl5_total.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_total.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- repl5_total.c 10 Nov 2006 23:45:17 -0000 1.9
+++ repl5_total.c 18 Oct 2007 00:08:31 -0000 1.10
@@ -634,7 +634,7 @@
/* The "attribute deleted" flag is next, and is optional */
if (ber_peek_tag(ber, &len) == LBER_BOOLEAN)
{
- if (ber_scanf(ber, "b", deleted) == -1)
+ if (ber_scanf(ber, "b", deleted) == LBER_DEFAULT)
{
goto loser;
}
Index: repl_controls.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_controls.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- repl_controls.c 10 Nov 2006 23:45:17 -0000 1.8
+++ repl_controls.c 18 Oct 2007 00:08:31 -0000 1.9
@@ -229,7 +229,7 @@
if (ber_peek_tag(tmp_bere, &len) == LBER_OCTETSTRING)
{
/* The optional superior_uuid is present */
- if (ber_scanf(tmp_bere, "o", &superior_uuid_val) == -1)
+ if (ber_scanf(tmp_bere, "o", &superior_uuid_val) == LBER_DEFAULT)
{
rc = -1;
goto loser;
Index: repl_extop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_extop.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- repl_extop.c 10 Nov 2006 23:45:17 -0000 1.11
+++ repl_extop.c 18 Oct 2007 00:08:31 -0000 1.12
@@ -110,7 +110,6 @@
struct berval *req_data = NULL;
BerElement *tmp_bere = NULL;
int rc = 0;
- const char *csnstr = NULL;
Object *repl_obj, *ruv_obj = NULL;
Replica *repl;
RUV *ruv;
@@ -203,7 +202,7 @@
}
/* Add the CSN */
PR_ASSERT(NULL != csn);
- if (ber_printf(tmp_bere, "s", csnstr = csn_as_string(csn,PR_FALSE,s)) == -1)
+ if (ber_printf(tmp_bere, "s", csn_as_string(csn,PR_FALSE,s)) == -1)
{
rc = LDAP_ENCODING_ERROR;
goto loser;
@@ -274,7 +273,7 @@
PR_ASSERT (ber && ruv);
- if (ber_scanf(ber, "[V]", &bvals) == -1)
+ if (ber_scanf(ber, "[V]", &bvals) == LBER_DEFAULT)
{
goto done;
}
@@ -339,12 +338,12 @@
goto free_and_return;
}
/* Get the required protocol OID and root of replicated subtree */
- if (ber_get_stringa(tmp_bere, protocol_oid) == -1)
+ if (ber_get_stringa(tmp_bere, protocol_oid) == LBER_DEFAULT)
{
rc = -1;
goto free_and_return;
}
- if (ber_get_stringa(tmp_bere, repl_root) == -1)
+ if (ber_get_stringa(tmp_bere, repl_root) == LBER_DEFAULT)
{
rc = -1;
goto free_and_return;
@@ -439,18 +438,18 @@
rc = -1;
goto free_and_return;
}
- if (ber_scanf(tmp_bere, "{") == -1)
+ if (ber_scanf(tmp_bere, "{") == LBER_DEFAULT)
{
rc = -1;
goto free_and_return;
}
/* Get the required root of replicated subtree */
- if (ber_get_stringa(tmp_bere, repl_root) == -1)
+ if (ber_get_stringa(tmp_bere, repl_root) == LBER_DEFAULT)
{
rc = -1;
goto free_and_return;
}
- if (ber_scanf(tmp_bere, "}") == -1)
+ if (ber_scanf(tmp_bere, "}") == LBER_DEFAULT)
{
rc = -1;
goto free_and_return;
@@ -494,7 +493,6 @@
else
{
ber_len_t len;
- ber_tag_t tag = 0;
ber_int_t temp_response_code = 0;
*ruv_bervals = NULL;
if ((tmp_bere = ber_init(data)) == NULL)
@@ -505,7 +503,7 @@
{
return_value = -1;
}
- else if ((tag = ber_peek_tag(tmp_bere, &len)) == LBER_SEQUENCE)
+ else if (ber_peek_tag(tmp_bere, &len) == LBER_SEQUENCE)
{
if (ber_scanf(tmp_bere, "{V}}", ruv_bervals) == LBER_ERROR)
{
@@ -1034,7 +1032,6 @@
ber_int_t response;
void *conn;
consumer_connection_extension *connext = NULL;
- int rc;
int connid=-1, opid=-1;
/* Decode the extended operation */
@@ -1092,7 +1089,7 @@
if (cl5GetState () == CL5_STATE_OPEN)
{
- rc = cl5DeleteDBSync (connext->replica_acquired);
+ cl5DeleteDBSync (connext->replica_acquired);
}
replica_set_ruv (r, connext->supplier_ruv);
@@ -1140,7 +1137,6 @@
/* Send the response code */
if ((resp_bere = der_alloc()) == NULL)
{
- rc = LDAP_ENCODING_ERROR;
goto free_and_return;
}
ber_printf(resp_bere, "{e}", response);
Index: repl_monitor.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_monitor.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- repl_monitor.c 10 Nov 2006 23:45:17 -0000 1.6
+++ repl_monitor.c 18 Oct 2007 00:08:31 -0000 1.7
@@ -46,8 +46,10 @@
#include "repl.h"
#include "slapi-plugin.h"
+#ifdef FOR_40_STYLE_CHANGELOG
/* Forward Declartions */
static int repl_monitor_search (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry*
entryAfter, int *returncode, char *returntext, void *arg);
+#endif
int
repl_monitor_init()
@@ -58,14 +60,17 @@
if (!initialized)
{
- /* ONREPL - this is commented until we implement 4.0 style changelog
-
slapi_config_register_callback(SLAPI_OPERATION_SEARCH,DSE_FLAG_PREOP,"cn=monitor",LDAP_SCOPE_BASE,"(objectclass=*)",repl_monitor_search,NULL);
*/
+#ifdef FOR_40_STYLE_CHANGELOG
+ /* ONREPL - this is commented until we implement 4.0 style changelog */
+
slapi_config_register_callback(SLAPI_OPERATION_SEARCH,DSE_FLAG_PREOP,"cn=monitor",LDAP_SCOPE_BASE,"(objectclass=*)",repl_monitor_search,NULL);
+#endif
initialized = 1;
}
return return_value;
}
+#ifdef FOR_40_STYLE_CHANGELOG
static int
repl_monitor_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int
*returncode, char *returntext, void *arg)
{
@@ -93,4 +98,5 @@
}
return SLAPI_DSE_CALLBACK_OK;
}
+#endif
Index: replutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/replutil.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- replutil.c 11 Jun 2007 17:22:37 -0000 1.10
+++ replutil.c 18 Oct 2007 00:08:31 -0000 1.11
@@ -824,7 +824,6 @@
int local_backend = -1; /* index of local backend */
int chaining_backend = -1; /* index of chain backend */
PRBool local_online = PR_FALSE; /* true if the local db is online */
- PRBool chain_online = PR_FALSE; /* true if the chain db is online */
int ii;
int opid;
#ifdef DEBUG_CHAIN_ON_UPDATE
@@ -850,10 +849,6 @@
if (slapi_be_is_flag_set(be,SLAPI_BE_FLAG_REMOTE_DATA))
{
chaining_backend = ii;
- if (mtn_be_states[ii] == SLAPI_BE_STATE_ON)
- {
- chain_online = PR_TRUE;
- }
}
else
{
Index: windows_connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_connection.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- windows_connection.c 27 Sep 2007 18:33:30 -0000 1.17
+++ windows_connection.c 18 Oct 2007 00:08:31 -0000 1.18
@@ -601,7 +601,6 @@
ConnResult return_value = 0;
int ldap_rc = 0;
LDAPMessage *res = NULL;
- int not_unique = 0;
int nummessages = 0;
int numentries = 0;
int numreferences = 0;
@@ -635,10 +634,7 @@
/* See if there are any more entries : if so then that's an error
* but we still need to get them to avoid gumming up the connection
*/
- while (NULL != ( message = ldap_next_entry(conn->ld,message)))
- {
- not_unique = 1;
- }
+ while (NULL != ( message = ldap_next_entry(conn->ld,message))) ;
return_value = CONN_OPERATION_SUCCESS;
}
else if (IS_DISCONNECT_ERROR(ldap_rc))
@@ -838,9 +834,8 @@
{
LDAPControl **returned_controls = NULL;
int code = 0;
- int parse_rc = 0;
/* Purify says this is a leak : */
- parse_rc = ldap_parse_result( conn->ld, res, &code, NULL, NULL, NULL,
&returned_controls, 0 );
+ ldap_parse_result( conn->ld, res, &code, NULL, NULL, NULL,
&returned_controls, 0 );
if (returned_controls)
{
windows_private_update_dirsync_control(conn->agmt, returned_controls);
@@ -1096,7 +1091,6 @@
ConnResult
windows_conn_connect(Repl_Connection *conn)
{
- int ldap_rc;
int optdata;
int secure = 0;
char* binddn = NULL;
@@ -1252,7 +1246,7 @@
}
else
{
- conn->last_ldap_error = ldap_rc = LDAP_SUCCESS;
+ conn->last_ldap_error = LDAP_SUCCESS;
conn->state = STATE_CONNECTED;
return_value = CONN_OPERATION_SUCCESS;
}
@@ -1291,7 +1285,7 @@
close_connection_internal(conn);
} else
{
- conn->last_ldap_error = ldap_rc = LDAP_SUCCESS;
+ conn->last_ldap_error = LDAP_SUCCESS;
conn->state = STATE_CONNECTED;
}
@@ -1863,22 +1857,6 @@
}
-static time_t
-PRTime2time_t (PRTime tm)
-{
- PRInt64 rt;
-
- LDAPDebug( LDAP_DEBUG_TRACE, "=> PRTime2time_t\n", 0, 0, 0 );
-
- PR_ASSERT (tm);
-
- LL_DIV(rt, tm, PR_USEC_PER_SEC);
-
- LDAPDebug( LDAP_DEBUG_TRACE, "<= PRTime2time_t\n", 0, 0, 0 );
-
- return (time_t)rt;
-}
-
static Slapi_Eq_Context
repl5_start_debug_timeout(int *setlevel)
{
Index: windows_inc_protocol.c
===================================================================
RCS file:
/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_inc_protocol.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- windows_inc_protocol.c 26 Sep 2007 05:43:34 -0000 1.14
+++ windows_inc_protocol.c 18 Oct 2007 00:08:31 -0000 1.15
@@ -277,8 +277,6 @@
int wait_change_timer_set = 0;
time_t last_start_time = 0;
PRUint32 num_changes_sent = 0;
- char *hostname = NULL;
- int portnum = 0;
/* use a different backoff timer strategy for ACQUIRE_REPLICA_BUSY errors */
PRBool use_busy_backoff_timer = PR_FALSE;
long pausetime = 0;
@@ -292,8 +290,6 @@
prp->stopped = 0;
prp->terminate = 0;
- hostname = agmt_get_hostname(prp->agmt);
- portnum = agmt_get_port(prp->agmt);
windows_private_load_dirsync_cookie(prp->agmt);
@@ -970,7 +966,6 @@
current_state = next_state;
} while (!done);
- slapi_ch_free((void**)&hostname);
/* remove_protocol_callbacks(prp); */
prp->stopped = 1;
/* Cancel any linger timer that might be in effect... */
Index: windows_private.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_private.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- windows_private.c 17 Sep 2007 19:18:30 -0000 1.16
+++ windows_private.c 18 Oct 2007 00:08:31 -0000 1.17
@@ -554,7 +554,9 @@
ber_int_t hasMoreData;
ber_int_t maxAttributeCount;
BerValue *serverCookie;
+#ifdef FOR_DEBUGGING
int return_value = LDAP_SUCCESS;
+#endif
LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_update_dirsync_control\n",
0, 0, 0 );
@@ -572,7 +574,9 @@
if ( !foundDirsyncControl )
{
+#ifdef FOR_DEBUGGING
return_value = LDAP_CONTROL_NOT_FOUND;
+#endif
goto choke;
}
else
@@ -584,7 +588,9 @@
if (ber_scanf( ber, "{iiO}", &hasMoreData, &maxAttributeCount,
&serverCookie) == LBER_ERROR)
{
+#ifdef FOR_DEBUGGING
return_value = LDAP_CONTROL_NOT_FOUND;
+#endif
goto choke;
}
@@ -603,12 +609,16 @@
}
else
{
+#ifdef FOR_DEBUGGING
return_value = LDAP_CONTROL_NOT_FOUND;
+#endif
}
-
+#ifdef FOR_DEBUGGING
+ LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control:
rc=%d\n", return_value, 0, 0 );
+#else
LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control\n",
0, 0, 0 );
- /* return return_value; */
+#endif
}
PRBool windows_private_dirsync_has_more(const Repl_Agmt *ra)
Index: windows_protocol_util.c
===================================================================
RCS file:
/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- windows_protocol_util.c 16 Oct 2007 20:17:37 -0000 1.36
+++ windows_protocol_util.c 18 Oct 2007 00:08:31 -0000 1.37
@@ -58,12 +58,10 @@
int ruv_private_new( RUV **ruv, RUV *clone );
-
+#ifdef FOR_DEBUGGING
static Slapi_Entry* windows_entry_already_exists(Slapi_Entry *e);
-static void windows_dirsync_now (Private_Repl_Protocol *prp);
-static Slapi_DN* map_dn_user(Slapi_DN *sdn, int map_to, const Slapi_DN *root);
-static Slapi_DN* map_dn_group(Slapi_DN *sdn, int map_to, const Slapi_DN *root);
-static void make_mods_from_entries(Slapi_Entry *new_entry, Slapi_Entry *existing_entry,
LDAPMod ***attrs);
+static void extract_guid_from_entry_bv(Slapi_Entry *e, const struct berval **bv);
+#endif
static void windows_map_mods_for_replay(Private_Repl_Protocol *prp,LDAPMod
**original_mods, LDAPMod ***returned_mods, int is_user, char** password);
static int is_subject_of_agreement_local(const Slapi_Entry *local_entry,const Repl_Agmt
*ra);
static int windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry
*original_entry, Slapi_DN *remote_sdn, Slapi_Entry **remote_entry, char** password);
@@ -395,6 +393,9 @@
original_dn_string = slapi_value_get_string(original_value);
/* Sanity check the data was a valid string */
original_dn_string_length = slapi_value_get_length(original_value);
+ if (0 == original_dn_string_length) {
+ slapi_log_error(SLAPI_LOG_REPL, NULL, "map_dn_values: length of dn is
0\n");
+ }
/* Make a sdn from the string */
original_dn = slapi_sdn_new_dn_byref(original_dn_string);
if (to_windows)
@@ -1098,9 +1099,10 @@
}
} else
{
- Slapi_Entry *remote_entry = NULL;
+ Slapi_Entry *remote_entry;
modify_fallback:
+ remote_entry = NULL;
/* Fetch the remote entry */
rc = windows_get_remote_entry(prp, remote_dn,&remote_entry);
if (0 == rc && remote_entry) {
@@ -1605,6 +1607,7 @@
return retval;
}
+#ifdef FOR_DEBUGGING
/* the entry has already been translated, so be sure to search for ntuserid
and not samaccountname or anything else. */
@@ -1632,6 +1635,7 @@
}
}
+#endif
static int
windows_delete_local_entry(Slapi_DN *sdn){
@@ -1740,13 +1744,12 @@
*/
if (0 == slapi_attr_type_cmp(mapped_type, "streetAddress",
SLAPI_TYPE_CMP_SUBTYPE)) {
Slapi_Mod smod;
- struct berval *new_bval = NULL;
slapi_mod_init_byref(&smod,mod);
/* Check if there is more than one value */
if (slapi_mod_get_num_values(&smod) > 1) {
- new_bval = slapi_mod_get_first_value(&smod);
+ slapi_mod_get_first_value(&smod);
/* Remove all values except for the first */
while (slapi_mod_get_next_value(&smod)) {
/* This modifies the bvalues in the mod itself */
@@ -2315,6 +2318,7 @@
return guid;
}
+#ifdef FOR_DEBUGGING
static void
extract_guid_from_entry_bv(Slapi_Entry *e, const struct berval **bv)
{
@@ -2330,6 +2334,7 @@
}
}
}
+#endif
static char*
extract_username_from_entry(Slapi_Entry *e)
Index: windows_tot_protocol.c
===================================================================
RCS file:
/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_tot_protocol.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- windows_tot_protocol.c 26 Sep 2007 05:43:34 -0000 1.11
+++ windows_tot_protocol.c 18 Oct 2007 00:08:31 -0000 1.12
@@ -70,8 +70,8 @@
Private_Repl_Protocol *prp;
int rc;
unsigned long num_entries;
- time_t sleep_on_busy;
- time_t last_busy;
+ time_t sleep_on_busy; /* not used ??? */
+ time_t last_busy; /* not used ??? */
} callback_data;
/*
@@ -100,8 +100,6 @@
callback_data cb_data;
Slapi_PBlock *pb;
const char* dn;
- CSN *remote_schema_csn = NULL;
- PRBool cookie_has_more = PR_TRUE;
RUV *ruv = NULL;
RUV *starting_ruv = NULL;
Replica *replica = NULL;
@@ -143,7 +141,6 @@
}
agmt_set_last_init_status(prp->agmt, 0, 0, "Total schema update in
progress");
- remote_schema_csn = agmt_get_consumer_schema_csn ( prp->agmt );
agmt_set_last_init_status(prp->agmt, 0, 0, "Total update in progress");
@@ -154,7 +151,6 @@
/* get everything */
windows_dirsync_inc_run(prp);
- cookie_has_more = windows_private_dirsync_has_more(prp->agmt);
windows_private_save_dirsync_cookie(prp->agmt);
@@ -350,10 +346,7 @@
{
int rc;
Private_Repl_Protocol *prp;
-
unsigned long *num_entriesp;
- time_t *sleep_on_busyp;
- time_t *last_busyp;
LDAPDebug( LDAP_DEBUG_TRACE, "=> send_entry\n", 0, 0, 0 );
@@ -361,8 +354,6 @@
prp = ((callback_data*)cb_data)->prp;
num_entriesp = &((callback_data *)cb_data)->num_entries;
- sleep_on_busyp = &((callback_data *)cb_data)->sleep_on_busy;
- last_busyp = &((callback_data *)cb_data)->last_busy;
PR_ASSERT (prp);
if (prp->terminate)