diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 688e4bded..1f6032853 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -39,8 +39,6 @@ #include "serialiser/rsnxsitems.h" #include "rsgxsutil.h" -#define DEFAULT_MSG_STORE_PERIOD 60*60*24*31*4 // 4 months - template class GxsPendingItem { @@ -128,7 +126,7 @@ public: */ RsGenExchange(RsGeneralDataService* gds, RsNetworkExchangeService* ns, RsSerialType* serviceSerialiser, uint16_t mServType, RsGixs* gixs, uint32_t authenPolicy, - uint32_t messageStorePeriod = DEFAULT_MSG_STORE_PERIOD); + uint32_t messageStorePeriod = RS_GXS_DEFAULT_MSG_STORE_PERIOD); virtual ~RsGenExchange(); diff --git a/libretroshare/src/gxs/rsgxs.h b/libretroshare/src/gxs/rsgxs.h index f609df1cd..ebbb9db4c 100644 --- a/libretroshare/src/gxs/rsgxs.h +++ b/libretroshare/src/gxs/rsgxs.h @@ -32,8 +32,13 @@ /* data types used throughout Gxs from netservice to genexchange */ -typedef std::map > GxsMsgMetaResult; +typedef std::map > GxsMsgMetaResult; typedef std::map > MsgRelatedMetaResult; +// Default values that are used throughout GXS code + +static const uint32_t RS_GXS_DEFAULT_MSG_STORE_PERIOD = 86400 * 31 * 6 ; // six months. Default time for which messages are keps in the database. +static const uint32_t RS_GXS_DEFAULT_MSG_SEND_PERIOD = 86400 * 31 * 1 ; // one months. Default delay after which we don't send messages +static const uint32_t RS_GXS_DEFAULT_MSG_REQ_PERIOD = 86400 * 31 * 1 ; // one months. Default Delay after which we don't request messages #endif // RSGXS_H diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 33e7c129f..0379a9238 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -679,7 +679,7 @@ void RsGxsNetService::syncGrpStatistics() for(std::map::const_iterator it(grpMeta.begin());it!=grpMeta.end();++it) { - RsGroupNetworkStatsRecord& rec(mGroupNetworkStats[it->first]) ; + RsGroupNetworkStatsRecord& rec(GrpConfigMap[it->first]) ; #ifdef NXS_NET_DEBUG_6 GXSNETDEBUG__G(it->first) << " group " << it->first ; #endif diff --git a/libretroshare/src/serialiser/rsgxsupdateitems.h b/libretroshare/src/serialiser/rsgxsupdateitems.h index 61f14cf39..9b65ef1bd 100644 --- a/libretroshare/src/serialiser/rsgxsupdateitems.h +++ b/libretroshare/src/serialiser/rsgxsupdateitems.h @@ -37,6 +37,7 @@ #include "serialiser/rstlvkeys.h" #endif +#include "gxs/rsgxs.h" #include "gxs/rsgxsdata.h" #include "serialiser/rstlvidset.h" @@ -50,20 +51,28 @@ const uint8_t RS_PKT_SUBTYPE_GXS_GRP_CONFIG = 0x09; class RsGxsGrpConfigItem : public RsItem { public: - RsGxsGrpConfigItem(uint16_t servType) : RsItem(RS_PKT_VERSION_SERVICE, servType, RS_PKT_SUBTYPE_GXS_GRP_CONFIG) {} + RsGxsGrpConfigItem(uint16_t servType) : RsItem(RS_PKT_VERSION_SERVICE, servType, RS_PKT_SUBTYPE_GXS_GRP_CONFIG) + { + msg_keep_delay = RS_GXS_DEFAULT_MSG_STORE_PERIOD ; + msg_send_delay = RS_GXS_DEFAULT_MSG_SEND_PERIOD ; + msg_req_delay = RS_GXS_DEFAULT_MSG_REQ_PERIOD ; + + max_visible_count = 0 ; + update_TS = 0 ; + } virtual ~RsGxsGrpConfigItem() {} virtual void clear() {} virtual std::ostream &print(std::ostream &out, uint16_t indent) { return out;} RsGxsGroupId grpId ; - uint32_t msg_keep_delay ; - uint32_t msg_send_delay ; - uint32_t msg_req_delay ; + uint32_t msg_keep_delay ; // delay after which we discard the posts + uint32_t msg_send_delay ; // delay after which we dont send the posts anymore + uint32_t msg_req_delay ; // delay after which we dont get the posts from friends - RsTlvPeerIdSet suppliers; - uint32_t max_visible_count ; - time_t update_TS ; + RsTlvPeerIdSet suppliers; // list of friends who feed this group + uint32_t max_visible_count ; // max visible count reported by contributing friends + time_t update_TS ; // last time the max visible count was updated. }; class RsGxsGrpUpdateItem : public RsItem {