mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 14:20:44 -04:00
Done most of the piping/callback between the DHT and LinkMgr/NetMgr.
* Added ConnectionFeedback fn to NetAssistConnect & p3BitDht. * Added TYPE definitions to pqiassist.h * added extra parameters to p3LinkMgr::connectAttempt() (flags which will be used to pass DIRECT/PROXY/DIRECT + PASSIVE/ACTIVE) * Added callback from p3LinkMgr to NetMgr::netAssistStatusUpdate() => Dht::ConnectionFeedback. * updated peerConnectRequest to trigger either TCP attempt (first) or UDP connection. * updated parameters for p3LinkMgrIMPL::tryConnectUDP() * added p3LinkMgrIMPL::locked_ConnectAttempt_SpecificAddress() for DHT => TCP attempt. * added extra parameter to addAddressIfUnique... bool addFront => DHT attempts get pushed to front of Queue due to timing requirements. * added extra parameter (flags) to pqiperson::connect() - matches extra parameters to p3LinkMgr::connectAttempt(). * added p3NetMgr::netAssistStatusUpdate() * added mConnectFlags to pqissludp git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4443 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
8d5bde1b50
commit
387db6e7b6
15 changed files with 275 additions and 49 deletions
|
@ -88,6 +88,8 @@ pqissludp::~pqissludp()
|
|||
int pqissludp::reset()
|
||||
{
|
||||
/* reset for next time.*/
|
||||
mConnectFlags = 0;
|
||||
mConnectPeriod = PQI_SSLUDP_DEF_CONN_PERIOD;
|
||||
return pqissl::reset();
|
||||
}
|
||||
|
||||
|
@ -131,14 +133,25 @@ int pqissludp::Initiate_Connection()
|
|||
"pqissludp::Initiate_Connection() Attempting Outgoing Connection....");
|
||||
|
||||
/* decide if we're active or passive */
|
||||
if (PeerId() < mLinkMgr->getOwnId())
|
||||
if (mConnectFlags & RS_CB_FLAG_CONN_ACTIVE)
|
||||
{
|
||||
sslmode = PQISSL_ACTIVE;
|
||||
}
|
||||
else
|
||||
else if (mConnectFlags & RS_CB_FLAG_CONN_PASSIVE)
|
||||
{
|
||||
sslmode = PQISSL_PASSIVE;
|
||||
}
|
||||
else // likely UNSPEC - use old method to decide.
|
||||
{
|
||||
if (PeerId() < mLinkMgr->getOwnId())
|
||||
{
|
||||
sslmode = PQISSL_ACTIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
sslmode = PQISSL_PASSIVE;
|
||||
}
|
||||
}
|
||||
|
||||
if (waiting != WAITING_DELAY)
|
||||
{
|
||||
|
@ -419,6 +432,15 @@ bool pqissludp::connect_parameter(uint32_t type, uint32_t value)
|
|||
mConnectPeriod = value;
|
||||
return true;
|
||||
}
|
||||
else if (type == NET_PARAM_CONNECT_FLAGS)
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "pqissludp::connect_parameter() Peer: " << PeerId() << " FLAGS: " << value;
|
||||
rslog(RSL_WARNING, pqissludpzone, out.str());
|
||||
|
||||
mConnectFlags = value;
|
||||
return true;
|
||||
}
|
||||
return pqissl::connect_parameter(type, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue