mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
Restored p3disc functionality.
* Bugfix in correctly adding ipList. * restored setLocal/Ext calls from peer. * Added extra debugging in p3disc. * Cleaned up debugging in p3connmgr. * switched off debugging in rsdiscitems. * reorder ipList (most recent first). * removed DEBUG switches in libretroshare.pro git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3252 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6f219d4fef
commit
8b2cb688a8
6 changed files with 276 additions and 162 deletions
|
@ -75,7 +75,7 @@ bool pqiIpAddrList::updateIpAddressList(const pqiIpAddress &addr)
|
|||
#endif
|
||||
add = true;
|
||||
}
|
||||
else if (mAddrs.begin()->mSeenTime < addr.mSeenTime)
|
||||
else if (mAddrs.back().mSeenTime < addr.mSeenTime)
|
||||
{
|
||||
#ifdef IPADDR_DEBUG
|
||||
std::cerr << "pqiIpAddrList::updateIpAddressList() oldAddr: Add";
|
||||
|
@ -121,11 +121,11 @@ bool pqiIpAddrList::updateIpAddressList(const pqiIpAddress &addr)
|
|||
}
|
||||
}
|
||||
|
||||
// ordered by increasing time. (oldest at front)
|
||||
// ordered by decreaseing time. (newest at front)
|
||||
bool added = false;
|
||||
for(it = mAddrs.begin(); it != mAddrs.end(); it++)
|
||||
{
|
||||
if (it->mSeenTime > addr.mSeenTime)
|
||||
if (it->mSeenTime < addr.mSeenTime)
|
||||
{
|
||||
#ifdef IPADDR_DEBUG
|
||||
std::cerr << "pqiIpAddrList::updateIpAddressList() added orig SeenTime: " << it->mSeenTime << " new SeenTime: " << addr.mSeenTime;
|
||||
|
@ -147,13 +147,13 @@ bool pqiIpAddrList::updateIpAddressList(const pqiIpAddress &addr)
|
|||
}
|
||||
|
||||
/* pop if necessary */
|
||||
if (mAddrs.size() > MAX_ADDRESS_LIST_SIZE)
|
||||
while (mAddrs.size() > MAX_ADDRESS_LIST_SIZE)
|
||||
{
|
||||
#ifdef IPADDR_DEBUG
|
||||
std::cerr << "pqiIpAddrList::updateIpAddressList() popping front";
|
||||
std::cerr << "pqiIpAddrList::updateIpAddressList() popping back";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
mAddrs.pop_front();
|
||||
mAddrs.pop_back();
|
||||
}
|
||||
|
||||
return newAddr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue