|
|
@ -595,7 +595,7 @@ namespace llarp
|
|
|
|
|
|
|
|
|
|
|
|
lastActive = parent->Now();
|
|
|
|
lastActive = parent->Now();
|
|
|
|
|
|
|
|
|
|
|
|
Pump = std::bind(&Session::PumpWrite, this);
|
|
|
|
Pump = std::bind(&Session::DoPump, this);
|
|
|
|
Tick = std::bind(&Session::TickImpl, this, std::placeholders::_1);
|
|
|
|
Tick = std::bind(&Session::TickImpl, this, std::placeholders::_1);
|
|
|
|
SendMessageBuffer =
|
|
|
|
SendMessageBuffer =
|
|
|
|
std::bind(&Session::QueueWriteBuffers, this, std::placeholders::_1);
|
|
|
|
std::bind(&Session::QueueWriteBuffers, this, std::placeholders::_1);
|
|
|
@ -717,6 +717,15 @@ namespace llarp
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
Session::DoPump()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// pump write queue
|
|
|
|
|
|
|
|
PumpWrite();
|
|
|
|
|
|
|
|
// prune inbound messages
|
|
|
|
|
|
|
|
PruneInboundMessages(parent->Now());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Session::QueueWriteBuffers(llarp_buffer_t buf)
|
|
|
|
Session::QueueWriteBuffers(llarp_buffer_t buf)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -894,8 +903,14 @@ namespace llarp
|
|
|
|
Addr remote(*arg->address);
|
|
|
|
Addr remote(*arg->address);
|
|
|
|
llarp::LogDebug("utp accepted from ", remote);
|
|
|
|
llarp::LogDebug("utp accepted from ", remote);
|
|
|
|
Session* session = new Session(self, arg->socket, remote);
|
|
|
|
Session* session = new Session(self, arg->socket, remote);
|
|
|
|
self->PutSession(session);
|
|
|
|
if(!self->PutSession(session))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
session->Close();
|
|
|
|
|
|
|
|
delete session;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
session->OnLinkEstablished(self);
|
|
|
|
session->OnLinkEstablished(self);
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|