diff options
| author | Nathan Kinder <nkinder@redhat.com> | 2008-10-17 22:12:48 +0000 |
|---|---|---|
| committer | Nathan Kinder <nkinder@redhat.com> | 2008-10-17 22:12:48 +0000 |
| commit | 567be2b6589e5fa3e11bb103f046bec55f37dd6b (patch) | |
| tree | 5c276c4fb82c4a010597898a4375556c92529249 /ldap/servers/plugins | |
| parent | 6b1364ff27b4a9499089f76938fcd82da9e70baf (diff) | |
Related: 207457
Summary: Add support for 64-bit counters (phase 1).
Diffstat (limited to 'ldap/servers/plugins')
| -rw-r--r-- | ldap/servers/plugins/acl/acl.c | 12 | ||||
| -rw-r--r-- | ldap/servers/plugins/acl/acl.h | 16 | ||||
| -rw-r--r-- | ldap/servers/plugins/acl/acl_ext.c | 4 | ||||
| -rw-r--r-- | ldap/servers/plugins/acl/aclanom.c | 4 | ||||
| -rw-r--r-- | ldap/servers/plugins/dna/dna.c | 9 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl.h | 16 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl5.h | 4 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl5_init.c | 5 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl5_replica.c | 12 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl5_total.c | 10 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl_connext.c | 4 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/repl_extop.c | 28 | ||||
| -rw-r--r-- | ldap/servers/plugins/replication/replutil.c | 60 |
13 files changed, 129 insertions, 55 deletions
diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c index 5262ca3e..77b95f17 100644 --- a/ldap/servers/plugins/acl/acl.c +++ b/ldap/servers/plugins/acl/acl.c @@ -297,7 +297,7 @@ acl_access_allowed( if ( !privateBackend && (be_readonly || slapi_config_get_readonly () )){ slapi_log_error (loglevel, plugin_name, - "conn=%d op=%d (main): Deny %s on entry(%s)" + "conn=%" PRIu64 " op=%d (main): Deny %s on entry(%s)" ": readonly backend\n", op->o_connid, op->o_opid, acl_access2str(access), @@ -310,7 +310,7 @@ acl_access_allowed( TNF_PROBE_0_DEBUG(acl_skipaccess_start,"ACL",""); if ( acl_skip_access_check ( pb, e )) { slapi_log_error (loglevel, plugin_name, - "conn=%d op=%d (main): Allow %s on entry(%s)" + "conn=%" PRIu64 " op=%d (main): Allow %s on entry(%s)" ": root user\n", op->o_connid, op->o_opid, acl_access2str(access), @@ -438,7 +438,7 @@ acl_access_allowed( TNF_PROBE_0_DEBUG(acl_entry_first_touch_start,"ACL",""); slapi_log_error(loglevel, plugin_name, - "#### conn=%d op=%d binddn=\"%s\"\n", + "#### conn=%" PRIu64 " op=%d binddn=\"%s\"\n", op->o_connid, op->o_opid, clientDn); aclpb->aclpb_stat_total_entries++; @@ -755,7 +755,7 @@ static void print_access_control_summary( char *source, int ret_val, char *clien null_user); slapi_log_error(loglevel, plugin_name, - "conn=%d op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" + "conn=%" PRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" ": %s\n", op->o_connid, op->o_opid, source, @@ -768,7 +768,7 @@ static void print_access_control_summary( char *source, int ret_val, char *clien } else { proxy_user = null_user; slapi_log_error(loglevel, plugin_name, - "conn=%d op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" + "conn=%" PRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" ": %s\n", op->o_connid, op->o_opid, source, @@ -781,7 +781,7 @@ static void print_access_control_summary( char *source, int ret_val, char *clien } } else{ slapi_log_error(loglevel, plugin_name, - "conn=%d op=%d (%s): %s %s on entry(%s).attr(%s) to %s" + "conn=%" PRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to %s" ": %s\n", op->o_connid, op->o_opid, source, diff --git a/ldap/servers/plugins/acl/acl.h b/ldap/servers/plugins/acl/acl.h index f1153b21..bccf4c54 100644 --- a/ldap/servers/plugins/acl/acl.h +++ b/ldap/servers/plugins/acl/acl.h @@ -49,6 +49,22 @@ #ifndef _ACL_H_ #define _ACL_H_ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> + +/* NSPR uses the print macros a bit differently than ANSI C. We + * need to use ll for a 64-bit integer, even when a long is 64-bit. + */ +#undef PRIu64 +#define PRIu64 "llu" +#undef PRI64 +#define PRI64 "ll" + +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #include <stdio.h> #include <string.h> #include <sys/types.h> diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c index de041017..4bb20e7e 100644 --- a/ldap/servers/plugins/acl/acl_ext.c +++ b/ldap/servers/plugins/acl/acl_ext.c @@ -973,7 +973,7 @@ acl__get_aclpb_type ( Acl_PBlock *aclpb ) static void acl__dump_stats ( struct acl_pblock *aclpb , const char *block_type) { - int connid = 0; + PRUint64 connid = 0; int opid = 0; Slapi_PBlock *pb = NULL; @@ -985,7 +985,7 @@ acl__dump_stats ( struct acl_pblock *aclpb , const char *block_type) /* DUMP STAT INFO */ slapi_log_error( SLAPI_LOG_ACL, plugin_name, - "**** ACL OPERATION STAT BEGIN ( aclpb:%p Block type: %s): Conn:%d Operation:%d *******\n", + "**** ACL OPERATION STAT BEGIN ( aclpb:%p Block type: %s): Conn:%" PRIu64 " Operation:%d *******\n", aclpb, block_type, connid, opid ); slapi_log_error( SLAPI_LOG_ACL, plugin_name, "\tNumber of entries scanned: %d\n", aclpb->aclpb_stat_total_entries); diff --git a/ldap/servers/plugins/acl/aclanom.c b/ldap/servers/plugins/acl/aclanom.c index e783c54d..c7621963 100644 --- a/ldap/servers/plugins/acl/aclanom.c +++ b/ldap/servers/plugins/acl/aclanom.c @@ -543,14 +543,14 @@ aclanom_match_profile (Slapi_PBlock *pb, struct acl_pblock *aclpb, Slapi_Entry * aci_ndn = slapi_sdn_get_ndn (acl_anom_profile->anom_targetinfo[i].anom_target); slapi_log_error(loglevel, plugin_name, - "conn=%d op=%d: Allow access on entry(%s).attr(%s) to anonymous: acidn=\"%s\"\n", + "conn=%" PRIu64 " op=%d: Allow access on entry(%s).attr(%s) to anonymous: acidn=\"%s\"\n", op->o_connid, op->o_opid, escape_string_with_punctuation(ndn, ebuf), attr ? attr:"NULL", escape_string_with_punctuation(aci_ndn, ebuf)); } else { slapi_log_error(loglevel, plugin_name, - "conn=%d op=%d: Deny access on entry(%s).attr(%s) to anonymous\n", + "conn=%" PRIu64 " op=%d: Deny access on entry(%s).attr(%s) to anonymous\n", op->o_connid, op->o_opid, escape_string_with_punctuation(ndn, ebuf), attr ? attr:"NULL" ); } diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index e96d090e..264d73a3 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -58,6 +58,15 @@ /* Required to get portable printf/scanf format macros */ #ifdef HAVE_INTTYPES_H #include <inttypes.h> + +/* NSPR uses the print macros a bit differently than ANSI C. We + * need to use ll for a 64-bit integer, even when a long is 64-bit. + */ +#undef PRIu64 +#define PRIu64 "llu" +#undef PRI64 +#define PRI64 "ll" + #else #error Need to define portable format macros such as PRIu64 #endif /* HAVE_INTTYPES_H */ diff --git a/ldap/servers/plugins/replication/repl.h b/ldap/servers/plugins/replication/repl.h index 05ea0929..ca0fe05b 100644 --- a/ldap/servers/plugins/replication/repl.h +++ b/ldap/servers/plugins/replication/repl.h @@ -44,6 +44,22 @@ #ifndef _REPL_H_ #define _REPL_H_ +/* Required to get portable printf/scanf format macros */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> + +/* NSPR uses the print macros a bit differently than ANSI C. We + * need to use ll for a 64-bit integer, even when a long is 64-bit. + */ +#undef PRIu64 +#define PRIu64 "llu" +#undef PRI64 +#define PRI64 "ll" + +#else +#error Need to define portable format macros such as PRIu64 +#endif /* HAVE_INTTYPES_H */ + #include <limits.h> #include <time.h> #include <stdio.h> diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h index 4a7f0db9..86834e8b 100644 --- a/ldap/servers/plugins/replication/repl5.h +++ b/ldap/servers/plugins/replication/repl5.h @@ -443,10 +443,10 @@ Replica *windows_replica_new(const Slapi_DN *root); during addition of the replica over LDAP */ Replica *replica_new_from_entry (Slapi_Entry *e, char *errortext, PRBool is_add_operation); void replica_destroy(void **arg); -PRBool replica_get_exclusive_access(Replica *r, PRBool *isInc, int connid, int opid, +PRBool replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opid, const char *locking_purl, char **current_purl); -void replica_relinquish_exclusive_access(Replica *r, int connid, int opid); +void replica_relinquish_exclusive_access(Replica *r, PRUint64 connid, int opid); PRBool replica_get_tombstone_reap_active(const Replica *r); const Slapi_DN *replica_get_root(const Replica *r); const char *replica_get_name(const Replica *r); diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c index 36af798b..b6d7de22 100644 --- a/ldap/servers/plugins/replication/repl5_init.c +++ b/ldap/servers/plugins/replication/repl5_init.c @@ -178,7 +178,8 @@ set_thread_private_cache ( void *buf ) char* get_repl_session_id (Slapi_PBlock *pb, char *idstr, CSN **csn) { - int connid=-1, opid=-1; + int opid=-1; + PRUint64 connid = 0; CSN *opcsn; char opcsnstr[CSN_STRSIZE]; @@ -192,7 +193,7 @@ get_repl_session_id (Slapi_PBlock *pb, char *idstr, CSN **csn) /* Avoid "Connection is NULL and hence cannot access SLAPI_CONN_ID" */ if (opid) { slapi_pblock_get (pb, SLAPI_CONN_ID, &connid); - PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%d op=%d", connid, opid); + PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" PRIu64 " op=%d", connid, opid); } slapi_pblock_get ( pb, SLAPI_OPERATION, &op ); diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index 69a44673..16c22325 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -405,7 +405,7 @@ replica_destroy(void **arg) * current_purl is the supplier who already has access, if any */ PRBool -replica_get_exclusive_access(Replica *r, PRBool *isInc, int connid, int opid, +replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opid, const char *locking_purl, char **current_purl) { @@ -421,7 +421,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, int connid, int opid, *isInc = (r->repl_state_flags & REPLICA_INCREMENTAL_IN_PROGRESS); slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": " + "conn=%" PRIu64 " op=%d repl=\"%s\": " "Replica in use locking_purl=%s\n", connid, opid, escape_string(slapi_sdn_get_dn(r->repl_root),ebuf), @@ -435,7 +435,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, int connid, int opid, else { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": Acquired replica\n", + "conn=%" PRIu64 " op=%d repl=\"%s\": Acquired replica\n", connid, opid, escape_string(slapi_sdn_get_dn(r->repl_root),ebuf)); r->repl_state_flags |= REPLICA_IN_USE; @@ -463,7 +463,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, int connid, int opid, * Relinquish exclusive access to the replica */ void -replica_relinquish_exclusive_access(Replica *r, int connid, int opid) +replica_relinquish_exclusive_access(Replica *r, PRUint64 connid, int opid) { char ebuf[BUFSIZ]; PRBool isInc; @@ -476,13 +476,13 @@ replica_relinquish_exclusive_access(Replica *r, int connid, int opid) if (!(r->repl_state_flags & REPLICA_IN_USE)) { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": " + "conn=%" PRIu64 " op=%d repl=\"%s\": " "Replica not in use\n", connid, opid, escape_string(slapi_sdn_get_dn(r->repl_root),ebuf)); } else { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": " + "conn=%" PRIu64 " op=%d repl=\"%s\": " "Released replica\n", connid, opid, escape_string(slapi_sdn_get_dn(r->repl_root),ebuf)); diff --git a/ldap/servers/plugins/replication/repl5_total.c b/ldap/servers/plugins/replication/repl5_total.c index 0a858dbf..7c3fcc3c 100644 --- a/ldap/servers/plugins/replication/repl5_total.c +++ b/ldap/servers/plugins/replication/repl5_total.c @@ -76,6 +76,7 @@ } */ +#include "repl.h" #include "repl5.h" #define CSN_TYPE_VALUE_UPDATED_ON_WIRE 1 @@ -848,11 +849,10 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) int rc; Slapi_Entry *e = NULL; Slapi_Connection *conn = NULL; - int connid, opid; + PRUint64 connid = 0; + int opid = 0; - connid = 0; slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); - opid = 0; slapi_pblock_get(pb, SLAPI_OPERATION_ID, &opid); /* Decode the extended operation */ @@ -881,7 +881,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) const char *dn = slapi_entry_get_dn_const(e); slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Error %d: could not import entry dn %s " - "for total update operation conn=%d op=%d\n", + "for total update operation conn=%" PRIu64 " op=%d\n", rc, dn, connid, opid); rc = -1; } @@ -891,7 +891,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Error %d: could not decode the total update extop " - "for total update operation conn=%d op=%d\n", + "for total update operation conn=%" PRIu64 " op=%d\n", rc, connid, opid); } diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c index 3b216b65..14151f58 100644 --- a/ldap/servers/plugins/replication/repl_connext.c +++ b/ldap/servers/plugins/replication/repl_connext.c @@ -78,7 +78,7 @@ void* consumer_connection_extension_constructor (void *object, void *parent) /* consumer connection extension destructor */ void consumer_connection_extension_destructor (void *ext, void *object, void *parent) { - int connid = 0; + PRUint64 connid = 0; if (ext) { /* Check to see if this replication session has acquired @@ -101,7 +101,7 @@ void consumer_connection_extension_destructor (void *ext, void *object, void *pa slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Aborting total update in progress for replicated " - "area %s connid=%d\n", slapi_sdn_get_dn(repl_root_sdn), + "area %s connid=%" PRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn), connid); slapi_stop_bulk_import(pb); } diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index 0cdba759..b286f209 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -562,7 +562,8 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) char *bind_dn = NULL; Object *ruv_object = NULL; RUV *supplier_ruv = NULL; - int connid, opid; + PRUint64 connid = 0; + int opid = 0; PRBool isInc = PR_FALSE; /* true if incremental update */ char *locking_purl = NULL; /* the supplier contacting us */ char *current_purl = NULL; /* the supplier which already has exclusive access */ @@ -581,9 +582,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) goto send_response; } - connid = 0; slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); - opid = 0; slapi_pblock_get(pb, SLAPI_OPERATION_ID, &opid); /* @@ -606,7 +605,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) /* Stash info that this is an incremental update session */ connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL; slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": Begin incremental protocol\n", + "conn=%" PRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n", connid, opid, repl_root); isInc = PR_TRUE; } @@ -618,7 +617,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) connext->repl_protocol_version = REPL_PROTOCOL_50_TOTALUPDATE; } slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": Begin total protocol\n", + "conn=%" PRIu64 " op=%d repl=\"%s\": Begin total protocol\n", connid, opid, repl_root); isInc = PR_FALSE; } @@ -627,7 +626,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) /* Stash info that this is an incremental update session */ connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL; slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": Begin 7.1 incremental protocol\n", + "conn=%" PRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n", connid, opid, repl_root); isInc = PR_TRUE; } @@ -639,7 +638,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) connext->repl_protocol_version = REPL_PROTOCOL_71_TOTALUPDATE; } slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": Begin 7.1 total protocol\n", + "conn=%" PRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n", connid, opid, repl_root); isInc = PR_FALSE; } @@ -661,7 +660,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) if (replica_is_being_configured(repl_root)) { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d replica=\"%s\": " + "conn=%" PRIu64 " op=%d replica=\"%s\": " "Replica is being configured: try again later\n", connid, opid, repl_root); response = NSDS50_REPL_REPLICA_BUSY; @@ -714,7 +713,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) { response = NSDS50_REPL_EXCESSIVE_CLOCK_SKEW; slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": " + "conn=%" PRIu64 " op=%d repl=\"%s\": " "Excessive clock skew from supplier RUV\n", connid, opid, repl_root); goto send_response; @@ -750,7 +749,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) if (check_replica_id_uniqueness(replica, supplier_ruv) != 0){ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": " + "conn=%" PRIu64 " op=%d repl=\"%s\": " "Replica has same replicaID %d as supplier\n", connid, opid, repl_root, replica_get_rid(replica)); response = NSDS50_REPL_REPLICAID_ERROR; @@ -763,7 +762,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) * the session's conn id and op id to identify the the supplier. */ /* junkrc = ruv_get_first_id_and_purl(supplier_ruv, &junkrid, &locking_purl); */ - PR_snprintf(locking_session, sizeof(locking_session), "conn=%d id=%d", connid, opid); + PR_snprintf(locking_session, sizeof(locking_session), "conn=%" PRIu64 " id=%d", connid, opid); locking_purl = &locking_session[0]; if (replica_get_exclusive_access(replica, &isInc, connid, opid, locking_purl, @@ -877,7 +876,7 @@ send_response: } slapi_log_error (resp_log_level, repl_plugin_name, - "conn=%d op=%d replica=\"%s\": " + "conn=%" PRIu64 " op=%d replica=\"%s\": " "Unable to acquire replica: error: %s%s\n", connid, opid, (replica ? slapi_sdn_get_dn(replica_get_root(replica)) : "unknown"), @@ -901,7 +900,7 @@ send_response: slapi_pblock_set(pb, SLAPI_EXT_OP_RET_OID, REPL_NSDS50_REPLICATION_RESPONSE_OID); slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, resp_bval); slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, - "conn=%d op=%d repl=\"%s\": " + "conn=%" PRIu64 " op=%d repl=\"%s\": " "StartNSDS50ReplicationRequest: response=%d rc=%d\n", connid, opid, repl_root, response, rc); @@ -1008,7 +1007,8 @@ multimaster_extop_EndNSDS50ReplicationRequest(Slapi_PBlock *pb) ber_int_t response; void *conn; consumer_connection_extension *connext = NULL; - int connid=-1, opid=-1; + PRUint64 connid = 0; + int opid=-1; /* Decode the extended operation */ if (decode_endrepl_extop(pb, &repl_root) == -1) diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c index 8b457a11..544ac116 100644 --- a/ldap/servers/plugins/replication/replutil.c +++ b/ldap/servers/plugins/replication/replutil.c @@ -817,16 +817,17 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, int repl_op = 0; int local_backend = -1; /* index of local backend */ int chaining_backend = -1; /* index of chain backend */ + int is_internal = 0; PRBool local_online = PR_FALSE; /* true if the local db is online */ int ii; int opid; #ifdef DEBUG_CHAIN_ON_UPDATE - int connid; + PRUint64 connid = 0; #endif slapi_pblock_get(pb, SLAPI_OPERATION, &op); #ifdef DEBUG_CHAIN_ON_UPDATE if (operation_is_flag_set(op, OP_FLAG_INTERNAL)) { - connid=-1; /* -1: internal op in a log msg */ + is_internal = 1; } else { slapi_pblock_get(pb, SLAPI_CONN_ID, &connid); } @@ -853,11 +854,18 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, } } #ifdef DEBUG_CHAIN_ON_UPDATE - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d be " - "%s is the %s backend and is %s\n", - connid, opid, - mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local", - (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline"); + if (is_internal) { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=-1 op=%d be " + "%s is the %s backend and is %s\n", opid, + mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local", + (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline"); + } else { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d be " + "%s is the %s backend and is %s\n", connid, opid, + mtn_be_names[ii], (chaining_backend == ii) ? "chaining" : "local", + (mtn_be_states[ii] == SLAPI_BE_STATE_ON) ? "online" : "offline"); + + } #endif } @@ -880,9 +888,13 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, (op_type == SLAPI_OPERATION_UNBIND) || (op_type == SLAPI_OPERATION_COMPARE))) { #ifdef DEBUG_CHAIN_ON_UPDATE - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d op is " - "%d: using local backend\n", - connid, opid, op_type); + if (is_internal) { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=-1 op=%d op is " + "%d: using local backend\n", opid, op_type); + } else { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d op is " + "%d: using local backend\n", connid, opid, op_type); + } #endif return local_backend; } @@ -899,8 +911,13 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, slapi_pblock_get(pb, SLAPI_REQUESTOR_DN, &requestor_dn); if (slapi_dn_isroot(requestor_dn)) { #ifdef DEBUG_CHAIN_ON_UPDATE - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d requestor " + if (is_internal) { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=-1 op=%d requestor " + "is root: using local backend\n", opid); + } else { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d requestor " "is root: using local backend\n", connid, opid); + } #endif return local_backend; } @@ -911,8 +928,13 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, slapi_pblock_get(pb, SLAPI_IS_REPLICATED_OPERATION, &repl_op); if (repl_op) { #ifdef DEBUG_CHAIN_ON_UPDATE - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d op is " + if (is_internal) { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=-1 op=%d op is " + "replicated: using local backend\n", opid); + } else { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d op is " "replicated: using local backend\n", connid, opid); + } #endif return local_backend; } @@ -923,8 +945,13 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, extern int config_get_pw_is_global_policy(); if (!config_get_pw_is_global_policy()) { #ifdef DEBUG_CHAIN_ON_UPDATE - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d using " + if (is_internal) { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=-1 op=%d using " + "local backend for local password policy\n", opid); + } else { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d using " "local backend for local password policy\n", connid, opid); + } #endif return local_backend; } @@ -935,8 +962,13 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, * use the chaining backend */ #ifdef DEBUG_CHAIN_ON_UPDATE - slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%d op=%d using " + if (is_internal) { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=-1 op=%d using " + "chaining backend\n", opid); + } else { + slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "repl_chain_on_update: conn=%" PRIu64 " op=%d using " "chaining backend\n", connid, opid); + } #endif return chaining_backend; } |
