From fd84639a4520980884e90483872c0743e9809cb0 Mon Sep 17 00:00:00 2001 From: cyril soler Date: Fri, 10 Mar 2017 15:05:41 +0100 Subject: [PATCH] removed some debug info --- libretroshare/src/gxs/rsgenexchange.cc | 3 ++- libretroshare/src/gxs/rsgxsdataaccess.cc | 2 +- libretroshare/src/gxs/rsgxsutil.cc | 2 ++ libretroshare/src/pqi/p3peermgr.cc | 2 ++ libretroshare/src/services/p3idservice.cc | 16 ++++++++++++++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index 742bec46d..eea94aea8 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -30,6 +30,7 @@ #include "rsgenexchange.h" #include "gxssecurity.h" #include "util/contentvalue.h" +#include "util/rsprint.h" #include "retroshare/rsgxsflags.h" #include "retroshare/rsgxscircles.h" #include "retroshare/rsgrouter.h" @@ -1323,7 +1324,7 @@ bool RsGenExchange::getGroupData(const uint32_t &token, std::vector50)?"...":"") << std::endl; std::cerr << std::endl; } delete *lit; diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index a4d6f5d22..8fcbbde5d 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -50,7 +50,7 @@ bool RsGxsDataAccess::requestGroupInfo(uint32_t &token, uint32_t ansType, const { if(groupIds.empty()) { - std::cerr << "Group Id list is empty" << std::endl; + std::cerr << "(WW) Group Id list is empty" << std::endl; return false; } diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 2e9ce5204..f37ed67ba 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -195,7 +195,9 @@ bool RsGxsIntegrityCheck::check() if(stats.mSuppliers == 0 && stats.mMaxVisibleCount == 0 && stats.mGrpAutoSync) { +#ifdef DEBUG_GXSUTIL GXSUTIL_DEBUG() << "Scheduling group \"" << grp->metaData->mGroupName << "\" ID=" << grp->grpId << " in service " << std::hex << mGenExchangeClient->serviceType() << std::dec << " for deletion because it has no suppliers not any visible data at friends." << std::endl; +#endif grpsToDel.push_back(grp->grpId); } } diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index 2263fd9dd..97e738a40 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -2790,7 +2790,9 @@ bool p3PeerMgrIMPL::removeBannedIps() { RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ +#ifdef PEER_DEBUG std::cerr << "Cleaning known IPs for all peers." << std::endl; +#endif bool changed = false ; for( std::map::iterator it = mFriendList.begin(); it != mFriendList.end(); ++it) diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index db803abdc..53b922327 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -407,11 +407,15 @@ public: bool is_signed_id = (bool)(entry.details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED) ; bool is_a_contact = (bool)(entry.details.mFlags & RS_IDENTITY_FLAGS_IS_A_CONTACT) ; +#ifdef DEBUG_IDS std::cerr << "Identity: " << gxs_id << ": banned: " << is_id_banned << ", own: " << is_own_id << ", contact: " << is_a_contact << ", signed: " << is_signed_id << ", known: " << is_known_id; +#endif if(is_own_id || is_a_contact) { +#ifdef DEBUG_IDS std::cerr << " => kept" << std::endl; +#endif return true ; } @@ -439,15 +443,21 @@ public: else max_keep_time = MAX_KEEP_KEYS_DEFAULT ; +#ifdef DEBUG_IDS std::cerr << ". Max keep = " << max_keep_time/86400 << " days. Unused for " << (now - last_usage_ts + 86399)/86400 << " days " ; +#endif if(should_check && now > last_usage_ts + max_keep_time) { +#ifdef DEBUG_IDS std::cerr << " => delete " << std::endl; +#endif ids_to_delete.push_back(gxs_id) ; } +#ifdef DEBUG_IDS else std::cerr << " => keep " << std::endl; +#endif return true; } @@ -484,7 +494,9 @@ void p3IdService::cleanUnusedKeys() for(std::list::const_iterator it(ids_to_delete.begin());it!=ids_to_delete.end();++it) { +#ifdef DEBUG_IDS std::cerr << "Deleting identity " << *it << " which is too old." << std::endl; +#endif uint32_t token ; RsGxsIdGroup group; group.mMeta.mGroupId=RsGxsGroupId(*it); @@ -518,7 +530,9 @@ bool p3IdService::acceptNewGroup(const RsGxsGrpMetaData *grpMeta) { bool res = !rsReputations->isIdentityBanned(RsGxsId(grpMeta->mGroupId)) ; +#ifdef DEBUG_IDS std::cerr << "p3IdService::acceptNewGroup: ID=" << grpMeta->mGroupId << ": " << (res?"ACCEPTED":"DENIED") << std::endl; +#endif return res ; } @@ -866,7 +880,9 @@ bool p3IdService::requestKey(const RsGxsId &id, const std::list& peers // Normally we should call getIdDetails(), but since the key is not known, we need to digg a possibly old information // from the reputation system, which keeps its own list of banned keys. Of course, the owner ID is not known at this point. +#ifdef DEBUG_IDS std::cerr << "p3IdService::requesting key " << id <getReputationInfo(id,RsPgpId(),info) ;