mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 19:12:28 -04:00
More Plumbing changes.
* Forgot that RELAY connections need extra parameters. * Added proxyAddr, srcAddr and Bandwidth parameters to connection attempts. * Completed UDP connection callouts from p3bitdht. * Added TCP connection attempt initiation from p3bitdht. * Added PASSIVE / ACTIVE determination in p3bitdht. * completed UDP connection logic in pqissludp. * enabled UDPSTUN_ALLOW_LOCALNET for testing. * added CONSTs for TOU Receiver Indices. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4446 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
22debbce34
commit
86bdc5dfd0
14 changed files with 399 additions and 60 deletions
|
@ -1905,8 +1905,8 @@ int RsServer::StartupRetroShare()
|
|||
/* construct the rest of the stack, important to build them in the correct order! */
|
||||
/* MOST OF THIS IS COMMENTED OUT UNTIL THE REST OF libretroshare IS READY FOR IT! */
|
||||
|
||||
UdpSubReceiver *udpReceivers[3];
|
||||
int udpTypes[3];
|
||||
UdpSubReceiver *udpReceivers[RSUDP_NUM_TOU_RECVERS];
|
||||
int udpTypes[RSUDP_NUM_TOU_RECVERS];
|
||||
|
||||
// FIRST DHT STUNNER.
|
||||
UdpStunner *mDhtStunner = new UdpStunner(mDhtStack);
|
||||
|
@ -1920,14 +1920,14 @@ int RsServer::StartupRetroShare()
|
|||
|
||||
// NEXT THE RELAY (NEED to keep a reference for installing RELAYS)
|
||||
UdpRelayReceiver *mRelay = new UdpRelayReceiver(mDhtStack);
|
||||
udpReceivers[2] = mRelay; /* RELAY Connections (DHT Port) */
|
||||
udpTypes[2] = TOU_RECEIVER_TYPE_UDPRELAY;
|
||||
mDhtStack->addReceiver(udpReceivers[2]);
|
||||
udpReceivers[RSUDP_TOU_RECVER_RELAY_IDX] = mRelay; /* RELAY Connections (DHT Port) */
|
||||
udpTypes[RSUDP_TOU_RECVER_RELAY_IDX] = TOU_RECEIVER_TYPE_UDPRELAY;
|
||||
mDhtStack->addReceiver(udpReceivers[RSUDP_TOU_RECVER_RELAY_IDX]);
|
||||
|
||||
// LAST ON THIS STACK IS STANDARD DIRECT TOU
|
||||
udpReceivers[0] = new UdpPeerReceiver(mDhtStack); /* standard DIRECT Connections (DHT Port) */
|
||||
udpTypes[0] = TOU_RECEIVER_TYPE_UDPPEER;
|
||||
mDhtStack->addReceiver(udpReceivers[0]);
|
||||
udpReceivers[RSUDP_TOU_RECVER_DIRECT_IDX] = new UdpPeerReceiver(mDhtStack); /* standard DIRECT Connections (DHT Port) */
|
||||
udpTypes[RSUDP_TOU_RECVER_DIRECT_IDX] = TOU_RECEIVER_TYPE_UDPPEER;
|
||||
mDhtStack->addReceiver(udpReceivers[RSUDP_TOU_RECVER_DIRECT_IDX]);
|
||||
|
||||
// NOW WE BUILD THE SECOND STACK.
|
||||
// Create the Second UdpStack... Port should be random (but openable!).
|
||||
|
@ -1947,12 +1947,12 @@ int RsServer::StartupRetroShare()
|
|||
mProxyStack->addReceiver(mProxyStunner);
|
||||
|
||||
// FINALLY THE PROXY UDP CONNECTIONS
|
||||
udpReceivers[1] = new UdpPeerReceiver(mProxyStack); /* PROXY Connections (Alt UDP Port) */
|
||||
udpTypes[1] = TOU_RECEIVER_TYPE_UDPPEER;
|
||||
mProxyStack->addReceiver(udpReceivers[1]);
|
||||
udpReceivers[RSUDP_TOU_RECVER_PROXY_IDX] = new UdpPeerReceiver(mProxyStack); /* PROXY Connections (Alt UDP Port) */
|
||||
udpTypes[RSUDP_TOU_RECVER_PROXY_IDX] = TOU_RECEIVER_TYPE_UDPPEER;
|
||||
mProxyStack->addReceiver(udpReceivers[RSUDP_TOU_RECVER_PROXY_IDX]);
|
||||
|
||||
// REAL INITIALISATION - WITH THREE MODES
|
||||
tou_init((void **) udpReceivers, udpTypes, 3);
|
||||
tou_init((void **) udpReceivers, udpTypes, RSUDP_NUM_TOU_RECVERS);
|
||||
|
||||
mBitDht->setupConnectBits(mDhtStunner, mProxyStunner, mRelay);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue