more strict connection timeouts

This commit is contained in:
Jeff Becker 2019-05-25 12:27:42 -04:00
parent 27c101cc32
commit fa25bfc797
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 5 additions and 3 deletions

View File

@ -330,7 +330,7 @@ namespace llarp
const AddressInfo& addr)
{
return std::make_shared< OutboundSession >(
this, utp_create_socket(_utp_ctx), rc, addr);
this, NewSocket(), rc, addr);
}
uint64

View File

@ -194,10 +194,12 @@ namespace llarp
bool
Session::TimedOut(llarp_time_t now) const
{
if(state == eInitial || state == eLinkEstablished)
return false;
if(state == eConnecting)
return now - lastActive > 5000;
if(sendq.size() >= MaxSendQueueSize)
{
if(now <= lastSend)
return false;
return now - lastSend > 5000;
}
// let utp manage this