From 67cd2a14070b9d4f1b4333e4fe756edc6e1850f7 Mon Sep 17 00:00:00 2001 From: sehraf Date: Mon, 5 Nov 2018 11:00:32 +0100 Subject: [PATCH] Add a build-time switch to set whether GXS distributes all available data or only sends data withint the configured sync period. --- libretroshare/src/gxs/rsgxsnetservice.cc | 7 ++++++- retroshare.pri | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 65d5d19b8..8e1aca41a 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -4382,7 +4382,9 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_ rstime_t now = time(NULL) ; +#ifndef RS_GXS_SEND_ALL uint32_t max_send_delay = locked_getGrpConfig(item->grpId).msg_req_delay; // we should use "sync" but there's only one variable used in the GUI: the req one. +#endif if(canSendMsgIds(msgMetas, *grpMeta, peer, should_encrypt_to_this_circle_id)) { @@ -4413,8 +4415,11 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_ } } // Check publish TS - +#ifndef RS_GXS_SEND_ALL if(item->createdSinceTS > (*vit)->mPublishTs || ((max_send_delay > 0) && (*vit)->mPublishTs + max_send_delay < now)) +#else + if(item->createdSinceTS > (*vit)->mPublishTs) +#endif { #ifdef NXS_NET_DEBUG_0 GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because it is too old (publishTS = " << (time(NULL)-(*vit)->mPublishTs)/86400 << " days ago" << std::endl; diff --git a/retroshare.pri b/retroshare.pri index 3422a77e9..ed662c417 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -111,6 +111,11 @@ rs_onlyhiddennode:CONFIG -= no_rs_onlyhiddennode CONFIG *= rs_gxs no_rs_gxs:CONFIG -= rs_gxs +# To disable GXS distrubuting all available posts independed of the "sync" settings append the following +# assignation to qmake command line "CONFIG+=no_rs_gxs_sendAll" +CONFIG *= rs_gxs_sendAll +no_rs_gxs_sendAll:CONFIG -= rs_gxs_sendAll + # To enable RS Deprecated Warnings append the following assignation to qmake # command line "CONFIG+=rs_deprecatedwarning" CONFIG *= no_rs_deprecatedwarning @@ -372,6 +377,7 @@ trough qmake command line arguments!") gxsdistsync:DEFINES *= RS_USE_GXS_DISTANT_SYNC wikipoos:DEFINES *= RS_USE_WIKI rs_gxs:DEFINES *= RS_ENABLE_GXS +rs_gxs_sendAll:DEFINES *= RS_GXS_SEND_ALL libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER libresapi_settings:DEFINES *= LIBRESAPI_SETTINGS libresapihttpserver:DEFINES *= ENABLE_WEBUI