Various Bugfixes:

* Clear discFlags before creating DiscItem packets.
 * Don't call stunStatus/peerStatus if refering to self (p3disc).
 * Expand allowed listen port range.
 * Limit max size of stored StunList.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@357 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-02-26 18:55:16 +00:00
parent b64b88df4a
commit e87b7b75e7
3 changed files with 7 additions and 3 deletions

View File

@ -2116,7 +2116,9 @@ std::list<RsItem *> p3ConnectMgr::saveList(bool &cleanup)
RsPeerStunItem *sitem = new RsPeerStunItem();
std::list<std::string>::iterator sit;
for(sit = mStunList.begin(); sit != mStunList.end(); sit++)
uint32_t count = 0;
for(sit = mStunList.begin(); (sit != mStunList.end()) &&
(count < RS_STUN_LIST_MIN); sit++, count++)
{
sitem->stunList.ids.push_back(*sit);
}

View File

@ -41,7 +41,7 @@
#define PQI_MIN_PORT 1024
#define PQI_MAX_PORT 16000
#define PQI_MAX_PORT 50000
#define PQI_DEFAULT_PORT 7812
int getPQIsearchId();

View File

@ -326,6 +326,7 @@ void p3disc::sendOwnDetails(std::string to)
di -> contact_tf = 0;
/* construct disc flags */
di -> discFlags = 0;
if (!(detail.visState & RS_VIS_STATE_NODISC))
{
di->discFlags |= P3DISC_FLAGS_USE_DISC;
@ -545,7 +546,8 @@ void p3disc::recvPeerFriendMsg(RsDiscReply *item)
flags |= RS_NET_FLAGS_EXTERNAL_ADDR;
}
if (loaded)
/* only valid certs, and not ourselves */
if ((loaded) && (peerId != mConnMgr->getOwnId()))
{
mConnMgr->peerStatus(peerId, item->laddr,
item->saddr, type, flags, RS_CB_DISC);