mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
27 lines
493 B
C++
27 lines
493 B
C++
#include <utp/inbound_message.hpp>
|
|
|
|
#include <string.h>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace utp
|
|
{
|
|
bool
|
|
InboundMessage::IsExpired(llarp_time_t now) const
|
|
{
|
|
return now > lastActive && now - lastActive >= 2000;
|
|
}
|
|
|
|
bool
|
|
InboundMessage::AppendData(const byte_t* ptr, uint16_t sz)
|
|
{
|
|
if(buffer.size_left() < sz)
|
|
return false;
|
|
memcpy(buffer.cur, ptr, sz);
|
|
buffer.cur += sz;
|
|
return true;
|
|
}
|
|
} // namespace utp
|
|
|
|
} // namespace llarp
|