disabled outgoing normal connections - if hidden node.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6730 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2013-09-11 07:00:33 +00:00
parent 1d6f99de0d
commit 5322040d29
4 changed files with 24 additions and 0 deletions

View File

@ -1478,6 +1478,13 @@ bool p3LinkMgrIMPL::tryConnectUDP(const std::string &id, struct sockaddr_in &r
return false; return false;
#endif #endif
if (mPeerMgr->isHidden())
{
std::cerr << "p3LinkMgrIMPL::tryConnectUDP() isHidden(): no connection attempts for : " << id;
std::cerr << std::endl;
return false;
}
RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/ RsStackMutex stack(mLinkMtx); /****** STACK LOCK MUTEX *******/
@ -1617,6 +1624,12 @@ bool p3LinkMgrIMPL::retryConnectTCP(const std::string &id)
return false; return false;
} }
if (mPeerMgr->isHidden())
{
std::cerr << "p3LinkMgrIMPL::retryConnectTCP() isHidden(): no connection attempts for : " << id;
std::cerr << std::endl;
return false;
}
struct sockaddr_in lAddr; struct sockaddr_in lAddr;
struct sockaddr_in eAddr; struct sockaddr_in eAddr;

View File

@ -308,6 +308,13 @@ bool p3PeerMgrIMPL::getGpgId(const std::string &ssl_id, std::string &gpgId)
/**** HIDDEN STUFF ****/ /**** HIDDEN STUFF ****/
bool p3PeerMgrIMPL::isHidden()
{
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
return mOwnState.hiddenNode;
}
bool p3PeerMgrIMPL::isHiddenPeer(const std::string &ssl_id) bool p3PeerMgrIMPL::isHiddenPeer(const std::string &ssl_id)
{ {
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/ RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/

View File

@ -197,6 +197,7 @@ virtual bool getGpgId(const std::string &sslId, std::string &gpgId) = 0;
virtual uint32_t getConnectionType(const std::string &sslId) = 0; virtual uint32_t getConnectionType(const std::string &sslId) = 0;
virtual bool setProxyServerAddress(const struct sockaddr_in &proxy_addr) = 0; virtual bool setProxyServerAddress(const struct sockaddr_in &proxy_addr) = 0;
virtual bool isHidden() = 0;
virtual bool isHiddenPeer(const std::string &ssl_id) = 0; virtual bool isHiddenPeer(const std::string &ssl_id) = 0;
virtual bool getProxyAddress(const std::string &ssl_id, struct sockaddr_in &proxy_addr, std::string &domain_addr, uint16_t &domain_port) = 0; virtual bool getProxyAddress(const std::string &ssl_id, struct sockaddr_in &proxy_addr, std::string &domain_addr, uint16_t &domain_port) = 0;
@ -293,6 +294,7 @@ virtual bool getGpgId(const std::string &sslId, std::string &gpgId);
virtual uint32_t getConnectionType(const std::string &sslId); virtual uint32_t getConnectionType(const std::string &sslId);
virtual bool setProxyServerAddress(const struct sockaddr_in &proxy_addr); virtual bool setProxyServerAddress(const struct sockaddr_in &proxy_addr);
virtual bool isHidden();
virtual bool isHiddenPeer(const std::string &ssl_id); virtual bool isHiddenPeer(const std::string &ssl_id);
virtual bool getProxyAddress(const std::string &ssl_id, struct sockaddr_in &proxy_addr, std::string &domain_addr, uint16_t &domain_port); virtual bool getProxyAddress(const std::string &ssl_id, struct sockaddr_in &proxy_addr, std::string &domain_addr, uint16_t &domain_port);

View File

@ -40,6 +40,8 @@
const int pqisslproxyzone = 3517; const int pqisslproxyzone = 3517;
#define PROXY_DEBUG 1
#define PROXY_STATE_FAILED 0 #define PROXY_STATE_FAILED 0
#define PROXY_STATE_INIT 1 #define PROXY_STATE_INIT 1
#define PROXY_STATE_WAITING_METHOD_RESPONSE 2 #define PROXY_STATE_WAITING_METHOD_RESPONSE 2