mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-16 04:52:37 -04:00
Improved the bootstrap Stun system.
* searching for STUN ID's continues until RS_STUN_FOUND_MIN are found (10). * abandon STUN search if Ext or Upnp mode. * add Bootstrap IDs to rear of mStunList. (bugfix) Force saving of certificates after "oldFormat" loading. Corrected printStunList() fn call. Added a notification system: (1) libretroshare System Notifications. - System notification if Firewall Status is bad. (2) PopUp messages. - Popup for a connected peer. - Popup for a new message. * New interface (to be revised). git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@376 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
08860b25e6
commit
0bdc3522a6
13 changed files with 579 additions and 26 deletions
|
@ -391,6 +391,8 @@ void p3DhtMgr::run()
|
|||
#ifdef DHT_DEBUG
|
||||
std::cerr << "p3DhtMgr::run() state = ACTIVE -> do stuff" << std::endl;
|
||||
#endif
|
||||
doStun();
|
||||
|
||||
period = checkOwnDHTKeys();
|
||||
#ifdef DHT_DEBUG
|
||||
std::cerr << "p3DhtMgr::run() checkOwnDHTKeys() period: " << period << std::endl;
|
||||
|
@ -792,18 +794,38 @@ int p3DhtMgr::checkNotifyDHT()
|
|||
|
||||
int p3DhtMgr::doStun()
|
||||
{
|
||||
#ifdef DHT_DEBUG
|
||||
std::cerr << "p3DhtMgr::doStun()" << std::endl;
|
||||
#endif
|
||||
if (stunIds.size() < 1)
|
||||
{
|
||||
#ifdef DHT_DEBUG
|
||||
std::cerr << "p3DhtMgr::doStun() Failed -> no Ids left" << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
dhtMtx.lock(); /* LOCK MUTEX */
|
||||
|
||||
bool stunRequired = mStunRequired;
|
||||
|
||||
dhtMtx.unlock(); /* UNLOCK MUTEX */
|
||||
|
||||
/* now loop through the peers */
|
||||
if (!stunRequired)
|
||||
{
|
||||
#ifdef DHT_DEBUG
|
||||
std::cerr << "p3DhtMgr::doStun() not Required" << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* pop the front one */
|
||||
std::string activeStunId = stunIds.front();
|
||||
|
||||
stunIds.pop_front();
|
||||
/* Don't recycle -> otherwise can end in an infinite (pointless) loop! */
|
||||
//stunIds.push_back(activeStunId);
|
||||
|
||||
#ifdef DHT_DEBUG
|
||||
std::cerr << "p3DhtMgr::doStun() STUN: " << RsUtil::BinToHex(activeStunId);
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
/* look it up! */
|
||||
dhtSearch(activeStunId, DHT_MODE_SEARCH);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue