Attempt 3 at fixing disconnections :)

* Added limit of 10kB for Certificate size. If it is bigger - discard certificate.
 * Remove certificates for slow / trickle connections (for Relay connections).



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4822 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2012-01-20 14:41:45 +00:00
parent 761bca8678
commit 611db96fb9
2 changed files with 41 additions and 3 deletions

View file

@ -975,14 +975,30 @@ void p3disc::setGPGOperation(AuthGPGOperation *operation)
}
#endif
// Send off message
item->certGPG = loadOrSave->m_certGpg;
/* for Relay Connections (and other slow ones) we don't want to
* to waste bandwidth sending certificates. So don't add it.
*/
uint32_t linkType = mLinkMgr->getLinkType(item->PeerId());
if ((linkType & RS_NET_CONN_SPEED_TRICKLE) ||
(linkType & RS_NET_CONN_SPEED_LOW))
{
std::cerr << "p3disc::setGPGOperation() Send DiscReply Packet to: ";
std::cerr << item->PeerId();
std::cerr << " without Certificate (low bandwidth)" << std::endl;
}
else
{
// Attaching Certificate.
item->certGPG = loadOrSave->m_certGpg;
}
#ifdef P3DISC_DEBUG
std::cerr << "p3disc::setGPGOperation() About to Send Message:" << std::endl;
item->print(std::cerr, 5);
#endif
// Send off message
sendItem(item);
#ifdef P3DISC_DEBUG