mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added load/save for IP ranges limit parameter in banlists
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8387 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
377eb50c6e
commit
dbf672e43b
@ -36,6 +36,7 @@
|
||||
#include "retroshare/rsbanlist.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <sstream>
|
||||
|
||||
/****
|
||||
* #define DEBUG_BANLIST 1
|
||||
@ -786,6 +787,13 @@ bool p3BanList::saveList(bool &cleanup, std::list<RsItem*>& itemlist)
|
||||
kv.value = mIPDHTGatheringEnabled?"TRUE":"FALSE" ;
|
||||
vitem->tlvkvs.pairs.push_back(kv) ;
|
||||
|
||||
kv.key = "IP_FILTERING_AUTORANGE_IPS_LIMIT" ;
|
||||
std::ostringstream os ;
|
||||
os << mAutoRangeLimit ;
|
||||
os.flush() ;
|
||||
kv.value = os.str() ;
|
||||
vitem->tlvkvs.pairs.push_back(kv) ;
|
||||
|
||||
itemlist.push_back(vitem) ;
|
||||
|
||||
return true ;
|
||||
@ -806,6 +814,13 @@ bool p3BanList::loadList(std::list<RsItem*>& load)
|
||||
if(it2->key == "IP_FILTERING_AUTORANGE_IPS") mAutoRangeIps = (it2->value=="TRUE") ;
|
||||
if(it2->key == "IP_FILTERING_FRIEND_GATHERING_ENABLED") mIPFriendGatheringEnabled = (it2->value=="TRUE") ;
|
||||
if(it2->key == "IP_FILTERING_DHT_GATHERING_ENABLED") mIPDHTGatheringEnabled = (it2->value=="TRUE") ;
|
||||
|
||||
if(it2->key == "IP_FILTERING_AUTORANGE_IPS_LIMIT")
|
||||
{
|
||||
int val ;
|
||||
if(sscanf(it2->value.c_str(),"%d",&val) == 1)
|
||||
mAutoRangeLimit = val ;
|
||||
}
|
||||
}
|
||||
|
||||
RsBanListConfigItem *citem = dynamic_cast<RsBanListConfigItem*>( *it ) ;
|
||||
|
Loading…
Reference in New Issue
Block a user