mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-15 04:22:27 -04:00
Bugfixes galore!
* Split p3bitdht_peers.cc debugging in two. Hid Id Translation debug (that code is fine) * Added initialisation of p3bitdht peer data structure (using values from peernet). * Added BITDHT_QFLAGS_UPDATES flag. * Added Tick() interface to NetAssistConnect interface, tick it from p3NetMgr. * FIXED OLD BUG: netAssistFriend was not being called from p3LinkMgr::connectResult() this meant all peers where being searched for. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4423 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d6e2d959be
commit
f7ff55237e
6 changed files with 170 additions and 52 deletions
|
@ -73,6 +73,7 @@ const uint32_t MIN_TIME_BETWEEN_NET_RESET = 5;
|
|||
* #define NETMGR_DEBUG_TICK 1
|
||||
***/
|
||||
|
||||
#define NETMGR_DEBUG 1
|
||||
#define NETMGR_DEBUG_RESET 1
|
||||
|
||||
pqiNetStatus::pqiNetStatus()
|
||||
|
@ -417,6 +418,7 @@ void p3NetMgr::netStartup()
|
|||
void p3NetMgr::tick()
|
||||
{
|
||||
netTick();
|
||||
netAssistConnectTick();
|
||||
}
|
||||
|
||||
#define STARTUP_DELAY 5
|
||||
|
@ -1258,25 +1260,19 @@ bool p3NetMgr::netAssistConnectShutdown()
|
|||
bool p3NetMgr::netAssistFriend(std::string id, bool on)
|
||||
{
|
||||
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
|
||||
std::list<pqiNetAssistConnect*> toFind ;
|
||||
std::list<pqiNetAssistConnect*> toDrop ;
|
||||
|
||||
#ifdef NETMGR_DEBUG
|
||||
std::cerr << "p3NetMgr::netAssistFriend(" << id << ", " << on << ")";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
for(it = mDhts.begin(); it != mDhts.end(); it++)
|
||||
{
|
||||
RsStackMutex stack(mNetMtx); /****** STACK LOCK MUTEX *******/
|
||||
for(it = mDhts.begin(); it != mDhts.end(); it++)
|
||||
{
|
||||
if (on)
|
||||
toFind.push_back(it->second) ;
|
||||
else
|
||||
toDrop.push_back(it->second) ;
|
||||
}
|
||||
if (on)
|
||||
(it->second)->findPeer(id);
|
||||
else
|
||||
(it->second)->dropPeer(id);
|
||||
}
|
||||
|
||||
for(std::list<pqiNetAssistConnect*>::const_iterator it(toFind.begin());it!=toFind.end();++it)
|
||||
(*it)->findPeer(id) ;
|
||||
for(std::list<pqiNetAssistConnect*>::const_iterator it(toDrop.begin());it!=toDrop.end();++it)
|
||||
(*it)->dropPeer(id) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1295,6 +1291,18 @@ bool p3NetMgr::netAssistSetAddress( struct sockaddr_in &laddr,
|
|||
return true;
|
||||
}
|
||||
|
||||
void p3NetMgr::netAssistConnectTick()
|
||||
{
|
||||
std::map<uint32_t, pqiNetAssistConnect *>::iterator it;
|
||||
for(it = mDhts.begin(); it != mDhts.end(); it++)
|
||||
{
|
||||
(it->second)->tick();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
**********************************************************************
|
||||
******************** Network State ***********************************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue