mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-21 23:40:26 -04:00
decided to continue propagating peer details in
- gxsnet now has a ctor option to disable auto group sync git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs_finale@6888 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
812ddef40e
commit
67c55991d7
6 changed files with 96 additions and 35 deletions
|
@ -820,6 +820,7 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, RsTlvSecu
|
|||
}else
|
||||
{
|
||||
std::list<std::string> peers;
|
||||
peers.push_back(msg->PeerId());
|
||||
mGixs->requestKey(metaData.mAuthorId, peers);
|
||||
return VALIDATE_FAIL_TRY_LATER;
|
||||
}
|
||||
|
@ -893,6 +894,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp, RsTlvSecurityKeySet& grpKeySet)
|
|||
}else
|
||||
{
|
||||
std::list<std::string> peers;
|
||||
peers.push_back(grp->PeerId());
|
||||
mGixs->requestKey(metaData.mAuthorId, peers);
|
||||
return VALIDATE_FAIL_TRY_LATER;
|
||||
}
|
||||
|
|
|
@ -36,16 +36,16 @@
|
|||
#define GIXS_CUT_OFF 0
|
||||
|
||||
#define SYNC_PERIOD 12 // in microseconds every 10 seconds (1 second for testing)
|
||||
#define TRANSAC_TIMEOUT 5 // 5 seconds
|
||||
#define TRANSAC_TIMEOUT 10 // 10 seconds
|
||||
|
||||
const uint32_t RsGxsNetService::FRAGMENT_SIZE = 150000;
|
||||
|
||||
RsGxsNetService::RsGxsNetService(uint16_t servType, RsGeneralDataService *gds,
|
||||
RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs, RsGixsReputation* reputations, RsGcxs* circles)
|
||||
RsNxsNetMgr *netMgr, RsNxsObserver *nxsObs, RsGixsReputation* reputations, RsGcxs* circles, bool grpAutoSync)
|
||||
: p3Config(servType), p3ThreadedService(servType),
|
||||
mTransactionTimeOut(TRANSAC_TIMEOUT), mServType(servType), mDataStore(gds), mTransactionN(0),
|
||||
mObserver(nxsObs), mNxsMutex("RsGxsNetService"), mNetMgr(netMgr), mSYNC_PERIOD(SYNC_PERIOD),
|
||||
mSyncTs(0), mReputations(reputations), mCircles(circles)
|
||||
mSyncTs(0), mReputations(reputations), mCircles(circles), mGrpAutoSync(grpAutoSync)
|
||||
|
||||
{
|
||||
addSerialType(new RsNxsSerialiser(mServType));
|
||||
|
@ -85,13 +85,16 @@ void RsGxsNetService::syncWithPeers()
|
|||
|
||||
std::set<std::string>::iterator sit = peers.begin();
|
||||
|
||||
// for now just grps
|
||||
for(; sit != peers.end(); sit++)
|
||||
if(mGrpAutoSync)
|
||||
{
|
||||
RsNxsSyncGrp *grp = new RsNxsSyncGrp(mServType);
|
||||
grp->clear();
|
||||
grp->PeerId(*sit);
|
||||
sendItem(grp);
|
||||
// for now just grps
|
||||
for(; sit != peers.end(); sit++)
|
||||
{
|
||||
RsNxsSyncGrp *grp = new RsNxsSyncGrp(mServType);
|
||||
grp->clear();
|
||||
grp->PeerId(*sit);
|
||||
sendItem(grp);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GXS_ENABLE_SYNC_MSGS
|
||||
|
@ -773,8 +776,7 @@ void RsGxsNetService::run(){
|
|||
|
||||
bool RsGxsNetService::locked_checkTransacTimedOut(NxsTransaction* tr)
|
||||
{
|
||||
//return tr->mTimeOut < ((uint32_t) time(NULL));
|
||||
return false;
|
||||
return tr->mTimeOut < ((uint32_t) time(NULL));
|
||||
}
|
||||
|
||||
void RsGxsNetService::processTransactions(){
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
* arrive
|
||||
*/
|
||||
RsGxsNetService(uint16_t servType, RsGeneralDataService* gds, RsNxsNetMgr* netMgr,
|
||||
RsNxsObserver* nxsObs = NULL, RsGixsReputation* repuations = NULL, RsGcxs* circles = NULL);
|
||||
RsNxsObserver* nxsObs = NULL, RsGixsReputation* repuations = NULL, RsGcxs* circles = NULL, bool grpAutoSync = true);
|
||||
|
||||
virtual ~RsGxsNetService();
|
||||
|
||||
|
@ -420,6 +420,7 @@ private:
|
|||
|
||||
RsGcxs* mCircles;
|
||||
RsGixsReputation* mReputations;
|
||||
bool mGrpAutoSync;
|
||||
|
||||
// need to be verfied
|
||||
std::vector<AuthorPending*> mPendingResp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue