mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-16 21:12:31 -04:00
Added Bandwidth and Delay parameters to BitDHT Connect Messages.
* Bandwidth are for RELAY connections. * Delays are for Exclusive NAT Proxy connections. * Lots of changes to achieve this. (Mainly added "param" to msgs). * Various Bugfixes too. * Updated BITDHT Version to 01 as we've changed Message Format. * Increased Connection Timeout to 180 * Added extra checks to kill duplicate connections early. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4462 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c33b415ef4
commit
551e2594bb
11 changed files with 371 additions and 147 deletions
|
@ -50,9 +50,10 @@
|
|||
#define BITDHT_VERSION_IDENTIFER 1
|
||||
|
||||
// Original RS 0.5.0/0.5.1 version, is un-numbered.
|
||||
#define BITDHT_VERSION "00" // First Release of BitDHT with Connections (Proxy Support + Dht Stun)
|
||||
//#define BITDHT_VERSION "01" // Full Connections
|
||||
//#define BITDHT_VERSION "02" // Full DHT implementation.
|
||||
//#define BITDHT_VERSION "00" // First Release of BitDHT with Connections (Proxy Support + Dht Stun)
|
||||
#define BITDHT_VERSION "01" // Testing Connections
|
||||
//#define BITDHT_VERSION "02" // Completed? Full Connections
|
||||
//#define BITDHT_VERSION "04" // Full DHT implementation.?
|
||||
|
||||
/*************************************/
|
||||
|
||||
|
@ -125,20 +126,21 @@ void UdpBitDht::removeCallback(BitDhtCallback *cb)
|
|||
mBitDhtManager->removeCallback(cb);
|
||||
}
|
||||
|
||||
bool UdpBitDht::ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t start)
|
||||
bool UdpBitDht::ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay, uint32_t start)
|
||||
{
|
||||
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
|
||||
|
||||
return mBitDhtManager->ConnectionRequest(laddr, target, mode, start);
|
||||
return mBitDhtManager->ConnectionRequest(laddr, target, mode, delay, start);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void UdpBitDht::ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId, uint32_t mode, uint32_t loc, uint32_t answer)
|
||||
void UdpBitDht::ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId, uint32_t mode, uint32_t loc,
|
||||
uint32_t bandwidth, uint32_t delay, uint32_t answer)
|
||||
{
|
||||
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
|
||||
|
||||
mBitDhtManager->ConnectionAuth(srcId, proxyId, destId, mode, loc, answer);
|
||||
mBitDhtManager->ConnectionAuth(srcId, proxyId, destId, mode, loc, bandwidth, delay, answer);
|
||||
}
|
||||
|
||||
void UdpBitDht::ConnectionOptions(uint32_t allowedModes, uint32_t flags)
|
||||
|
|
|
@ -68,8 +68,9 @@ virtual void addCallback(BitDhtCallback *cb);
|
|||
virtual void removeCallback(BitDhtCallback *cb);
|
||||
|
||||
/***** Connections Requests *****/
|
||||
virtual bool ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t start);
|
||||
virtual void ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId, uint32_t mode, uint32_t loc, uint32_t answer);
|
||||
virtual bool ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t delay, uint32_t start);
|
||||
virtual void ConnectionAuth(bdId *srcId, bdId *proxyId, bdId *destId, uint32_t mode, uint32_t loc,
|
||||
uint32_t bandwidth, uint32_t delay, uint32_t answer);
|
||||
virtual void ConnectionOptions(uint32_t allowedModes, uint32_t flags);
|
||||
|
||||
/***** Get Results Details *****/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue