reduced period for slow saving of GRouter config data, and removed useless saving of BanList config when received data fro friends does not modify the existing data

This commit is contained in:
csoler 2016-08-22 22:25:05 +02:00
parent a6acff491f
commit 5d69ae886a
2 changed files with 8 additions and 2 deletions

View File

@ -39,7 +39,7 @@ static const uint16_t GROUTER_CLIENT_ID_MESSAGES = 0x1001 ;
static const uint32_t RS_GROUTER_MATRIX_MAX_HIT_ENTRIES = 10 ; // max number of clues to store
static const uint32_t RS_GROUTER_MATRIX_MIN_TIME_BETWEEN_HITS = 60 ; // can be set to up to half the publish time interval. Prevents flooding routes.
static const uint32_t RS_GROUTER_MIN_CONFIG_SAVE_PERIOD = 10 ; // at most save config every 10 seconds
static const uint32_t RS_GROUTER_MIN_CONFIG_SAVE_PERIOD = 61 ; // at most save config every 10 seconds
static const uint32_t RS_GROUTER_MAX_KEEP_TRACKING_CLUES = 86400*10 ; // max time for which we keep record of tracking info: 10 days.
static const float RS_GROUTER_BASE_WEIGHT_ROUTED_MSG = 1.0f ; // base contribution of routed message clue to routing matrix

View File

@ -206,6 +206,8 @@ void p3BanList::autoFigureOutBanRanges()
{
RS_STACK_MUTEX(mBanMtx) ;
bool changed = false ;
// clear automatic ban ranges
for(std::map<sockaddr_storage,BanListPeer>::iterator it(mBanRanges.begin());it!=mBanRanges.end();)
@ -215,6 +217,8 @@ void p3BanList::autoFigureOutBanRanges()
++it2 ;
mBanRanges.erase(it) ;
it=it2 ;
changed = true ;
}
else
++it;
@ -968,7 +972,9 @@ bool p3BanList::addBanEntry(const RsPeerId &peerId, const struct sockaddr_storag
updated = true;
}
}
IndicateConfigChanged();
if(updated)
IndicateConfigChanged();
return updated;
}