mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 09:26:18 -05:00
fixed display of correct IP for connected friends. Only the external IP was shown previously. Port is not shown because it is random and could be misleading. Needs full recompilation
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6918 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6fe16d55e1
commit
dd22bd24d9
@ -271,6 +271,7 @@ bool p3LinkMgrIMPL::getFriendNetStatus(const std::string &id, peerConnectStat
|
||||
}
|
||||
|
||||
state = it->second;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -856,6 +857,7 @@ bool p3LinkMgrIMPL::connectResult(const std::string &id, bool success, uint32_t
|
||||
it->second.state |= RS_PEER_S_CONNECTED;
|
||||
it->second.actions |= RS_PEER_CONNECTED;
|
||||
it->second.connecttype = flags;
|
||||
it->second.connectaddr = remote_peer_address;
|
||||
|
||||
updateLastContact = true; /* time of connect */
|
||||
|
||||
|
@ -108,6 +108,8 @@ class peerConnectState
|
||||
peerAddrInfo disc;
|
||||
peerAddrInfo peer;
|
||||
|
||||
sockaddr_in connectaddr ; // current connection address. Can be local or external.
|
||||
|
||||
/* a list of connect attempts to make (in order) */
|
||||
bool inConnAttempt;
|
||||
peerConnectAddress currentConnAddrAttempt;
|
||||
|
@ -207,6 +207,8 @@ class RsPeerDetails
|
||||
/* Network details (only valid if friend) */
|
||||
uint32_t state;
|
||||
|
||||
std::string connectAddr ; // current address if connected.
|
||||
uint16_t connectPort ;
|
||||
std::string localAddr;
|
||||
uint16_t localPort;
|
||||
std::string extAddr;
|
||||
|
@ -373,6 +373,16 @@ bool p3Peers::getPeerDetails(const std::string &id, RsPeerDetails &d)
|
||||
std::cerr << "p3Peers::getPeerDetails() got a SSL id and is returning SSL and GPG details for id : " << id << std::endl;
|
||||
#endif
|
||||
|
||||
if (pcs.state & RS_PEER_S_CONNECTED)
|
||||
{
|
||||
d.connectAddr = rs_inet_ntoa(pcs.connectaddr.sin_addr) ;
|
||||
d.connectPort = pcs.connectaddr.sin_port ;
|
||||
}
|
||||
else
|
||||
{
|
||||
d.connectAddr = "";
|
||||
d.connectPort = 0 ;
|
||||
}
|
||||
|
||||
d.state = 0;
|
||||
if (pcs.state & RS_PEER_S_FRIEND)
|
||||
|
Loading…
Reference in New Issue
Block a user