Bugfixes for connection logic:

* added bool return value to ConnectionRequest. only returns false if MODE not allowed.
 * added checks for an existingConnectionRequest - results in a NOOP.
 * made each ConnectionRequest result in only one UDP start.
 * a START message will not kill a local ConnectionRequest (even in remotely started).
 * increased CONNECTION_TIMEOUT as this should never happen at this level.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4449 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-07-15 16:02:56 +00:00
parent bffaf6e5ef
commit 6609cec94d
7 changed files with 42 additions and 12 deletions

View file

@ -125,11 +125,11 @@ void UdpBitDht::removeCallback(BitDhtCallback *cb)
mBitDhtManager->removeCallback(cb);
}
void 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 start)
{
bdStackMutex stack(dhtMtx); /********** MUTEX LOCKED *************/
mBitDhtManager->ConnectionRequest(laddr, target, mode, start);
return mBitDhtManager->ConnectionRequest(laddr, target, mode, start);
}

View file

@ -68,7 +68,7 @@ virtual void addCallback(BitDhtCallback *cb);
virtual void removeCallback(BitDhtCallback *cb);
/***** Connections Requests *****/
virtual void ConnectionRequest(struct sockaddr_in *laddr, bdNodeId *target, uint32_t mode, uint32_t start);
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 void ConnectionOptions(uint32_t allowedModes, uint32_t flags);