mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Added EXTERNAL flags to p3disc callback (peerStatus).
Corrected id->hash for p3disc callback (stunStatus). git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@356 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
06cb9e0121
commit
b64b88df4a
@ -37,7 +37,9 @@ const uint32_t AUTODISC_LDI_SUBTYPE_PING = 0x01;
|
|||||||
const uint32_t AUTODISC_LDI_SUBTYPE_RPLY = 0x02;
|
const uint32_t AUTODISC_LDI_SUBTYPE_RPLY = 0x02;
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "pqi/pqidebug.h"
|
#include "pqi/pqidebug.h"
|
||||||
|
#include "util/rsprint.h"
|
||||||
|
|
||||||
const int pqidisczone = 2482;
|
const int pqidisczone = 2482;
|
||||||
|
|
||||||
@ -478,13 +480,15 @@ void p3disc::recvPeerOwnMsg(RsDiscItem *item)
|
|||||||
if (item->discFlags & P3DISC_FLAGS_EXTERNAL_ADDR)
|
if (item->discFlags & P3DISC_FLAGS_EXTERNAL_ADDR)
|
||||||
{
|
{
|
||||||
type |= RS_NET_CONN_TCP_EXTERNAL;
|
type |= RS_NET_CONN_TCP_EXTERNAL;
|
||||||
|
flags |= RS_NET_FLAGS_EXTERNAL_ADDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
mConnMgr->peerStatus(item->PeerId(), item->laddr, item->saddr,
|
mConnMgr->peerStatus(item->PeerId(), item->laddr, item->saddr,
|
||||||
type, flags, RS_CB_PERSON);
|
type, flags, RS_CB_PERSON);
|
||||||
|
|
||||||
/* also add as potential stun buddy */
|
/* also add as potential stun buddy */
|
||||||
mConnMgr->stunStatus(item->PeerId(), item->saddr, type,
|
std::string hashid1 = RsUtil::HashId(item->PeerId(), false);
|
||||||
|
mConnMgr->stunStatus(hashid1, item->saddr, type,
|
||||||
RS_STUN_ONLINE | RS_STUN_FRIEND);
|
RS_STUN_ONLINE | RS_STUN_FRIEND);
|
||||||
|
|
||||||
/* now reply with all details */
|
/* now reply with all details */
|
||||||
@ -538,6 +542,7 @@ void p3disc::recvPeerFriendMsg(RsDiscReply *item)
|
|||||||
if (item->discFlags & P3DISC_FLAGS_EXTERNAL_ADDR)
|
if (item->discFlags & P3DISC_FLAGS_EXTERNAL_ADDR)
|
||||||
{
|
{
|
||||||
type |= RS_NET_CONN_TCP_EXTERNAL;
|
type |= RS_NET_CONN_TCP_EXTERNAL;
|
||||||
|
flags |= RS_NET_FLAGS_EXTERNAL_ADDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loaded)
|
if (loaded)
|
||||||
@ -545,7 +550,8 @@ void p3disc::recvPeerFriendMsg(RsDiscReply *item)
|
|||||||
mConnMgr->peerStatus(peerId, item->laddr,
|
mConnMgr->peerStatus(peerId, item->laddr,
|
||||||
item->saddr, type, flags, RS_CB_DISC);
|
item->saddr, type, flags, RS_CB_DISC);
|
||||||
|
|
||||||
mConnMgr->stunStatus(peerId, item->saddr, type,
|
std::string hashid1 = RsUtil::HashId(peerId, false);
|
||||||
|
mConnMgr->stunStatus(hashid1, item->saddr, type,
|
||||||
RS_STUN_FRIEND_OF_FRIEND);
|
RS_STUN_FRIEND_OF_FRIEND);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user