mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-14 17:15:47 -04:00
Changes to support the delay / bandwidth changes in libbitdht
* switched off the TESTING PERIODS. * added BASE PROXY wait time. * Increased PEERNET_CONNECT_TIMEOUT to 120 * Prevented connection startup with Request underway (dpd->mPeerReqState == RSDHT_PEERREQ_RUNNING) * corrected calculation of Exclusive Delay (Target of MIN_DETERMINISTIC_SWITCH_PERIOD = 60 secs). * don't do UDP Failed ConnectLogic update when connection was initiated remotely. * Extended UdpRelay to allow flexible Bandwidth limits in the future. * Added Timeout for Relays (30min for unknowns - 2hrs for friends). * Extract bandwidth from UdpRelay, at installation. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4463 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
551e2594bb
commit
96ec46478a
6 changed files with 174 additions and 61 deletions
|
@ -57,6 +57,9 @@ class UdpRelayProxy
|
|||
time_t mLastBandwidthTS;
|
||||
time_t mLastTS;
|
||||
|
||||
time_t mStartTS;
|
||||
double mBandwidthLimit;
|
||||
|
||||
int mRelayClass;
|
||||
};
|
||||
|
||||
|
@ -100,6 +103,15 @@ std::ostream &operator<<(std::ostream &out, const UdpRelayEnd &ure);
|
|||
#define UDP_RELAY_CLASS_FOF 2
|
||||
#define UDP_RELAY_CLASS_FRIENDS 3
|
||||
|
||||
// Just for some testing fun!
|
||||
//#define UDP_RELAY_LIFETIME_GENERAL 180 // 3 minutes
|
||||
//#define UDP_RELAY_LIFETIME_FOF 360 // 6 minutes.
|
||||
//#define UDP_RELAY_LIFETIME_FRIENDS 720 // 12 minutes.
|
||||
|
||||
#define UDP_RELAY_LIFETIME_GENERAL 1800 // 30 minutes
|
||||
#define UDP_RELAY_LIFETIME_FOF 3600 // 1 Hour.
|
||||
#define UDP_RELAY_LIFETIME_FRIENDS 7200 // 2 Hour.
|
||||
|
||||
#define STD_RELAY_TTL 64
|
||||
|
||||
class UdpRelayReceiver: public UdpSubReceiver
|
||||
|
@ -119,7 +131,7 @@ int removeUdpPeer(UdpPeer *peer);
|
|||
* the end-points drop the connections
|
||||
*/
|
||||
|
||||
int addUdpRelay(UdpRelayAddrSet *addrs, int classIdx);
|
||||
int addUdpRelay(UdpRelayAddrSet *addrSet, int relayClass, uint32_t &bandwidth);
|
||||
int removeUdpRelay(UdpRelayAddrSet *addrs);
|
||||
|
||||
/* Need some stats, to work out how many relays we are supporting */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue