added compilation flag for GXS dist sync

This commit is contained in:
csoler 2018-04-25 14:58:53 +02:00
parent 3c9af3d2e7
commit 38b39caf13
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 16 additions and 7 deletions

View File

@ -569,7 +569,7 @@ void RsGxsNetService::syncWithPeers()
std::set<RsPeerId> peers;
mNetMgr->getOnlineList(mServiceInfo.mServiceType, peers);
if(mAllowDistSync)
if(mAllowDistSync && mGxsNetTunnel != NULL)
{
// Grab all online virtual peers of distant tunnels for the current service.
@ -740,7 +740,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si)
{
// check if the item is to be sent to a distant peer or not
if(mAllowDistSync && mGxsNetTunnel->isDistantPeer( static_cast<RsGxsNetTunnelVirtualPeerId>(si->PeerId())))
if(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->isDistantPeer( static_cast<RsGxsNetTunnelVirtualPeerId>(si->PeerId())))
{
RsNxsSerialiser ser(mServType);
@ -764,7 +764,7 @@ void RsGxsNetService::generic_sendItem(RsNxsItem *si)
void RsGxsNetService::checkDistantSyncState()
{
if(!mAllowDistSync)
if(!mAllowDistSync || mGxsNetTunnel==NULL)
return ;
RsGxsGrpMetaTemporaryMap grpMeta;
@ -1676,7 +1676,7 @@ RsItem *RsGxsNetService::generic_recvItem()
uint32_t size = 0 ;
RsGxsNetTunnelVirtualPeerId virtual_peer_id ;
while(mAllowDistSync && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id))
while(mAllowDistSync && mGxsNetTunnel != NULL && mGxsNetTunnel->receiveData(mServType,data,size,virtual_peer_id))
{
RsNxsItem *item = dynamic_cast<RsNxsItem*>(RsNxsSerialiser(mServType).deserialise(data,&size)) ;
item->PeerId(virtual_peer_id) ;

View File

@ -1358,6 +1358,14 @@ int RsServer::StartupRetroShare()
mWiki->setNetworkExchangeService(wiki_ns) ;
#endif
/**** GXS Dist sync service ****/
#ifdef RS_USE_GXS_DISTANT_SYNC
RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ;
#else
RsGxsNetTunnelService *mGxsNetTunnel = NULL;
#endif
/**** Forum GXS service ****/
RsGeneralDataService* gxsforums_ds = new RsDataService(currGxsDir + "/", "gxsforums_db",
@ -1371,14 +1379,12 @@ int RsServer::StartupRetroShare()
RS_SERVICE_GXS_TYPE_FORUMS, gxsforums_ds, nxsMgr,
mGxsForums, mGxsForums->getServiceInfo(),
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
pgpAuxUtils); //,mGxsNetTunnel,true,true,true);
mGxsForums->setNetworkExchangeService(gxsforums_ns) ;
/**** Channel GXS service ****/
RsGxsNetTunnelService *mGxsNetTunnel = new RsGxsNetTunnelService ;
RsGeneralDataService* gxschannels_ds = new RsDataService(currGxsDir + "/", "gxschannels_db",
RS_SERVICE_GXS_TYPE_CHANNELS, NULL, rsInitConfig->gxs_passwd);

View File

@ -9,6 +9,8 @@ no_retroshare_gui:CONFIG -= retroshare_gui
# CONFIG *= retrotor
CONFIG *= gxsdistsync
# To disable RetroShare-nogui append the following
# assignation to qmake command line "CONFIG+=no_retroshare_nogui"
CONFIG *= retroshare_nogui
@ -214,6 +216,7 @@ unfinished {
CONFIG += wikipoos
}
gxsdistsync:DEFINES *= RS_USE_GXS_DISTANT_SYNC
wikipoos:DEFINES *= RS_USE_WIKI
rs_gxs:DEFINES *= RS_ENABLE_GXS
libresapilocalserver:DEFINES *= LIBRESAPI_LOCAL_SERVER