mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-11 07:10:36 +00:00
273270916e
This commit reflects changes to clang-format rules. Unfortunately, these rule changes create a massive change to the codebase, which causes an apparent rewrite of git history. Git blame's --ignore-rev flag can be used to ignore this commit when attempting to `git blame` some code.
36 lines
697 B
C++
36 lines
697 B
C++
#ifndef LLARP_SERVICE_PENDINGBUFFER_HPP
|
|
#define LLARP_SERVICE_PENDINGBUFFER_HPP
|
|
|
|
#include <service/protocol.hpp>
|
|
#include <util/buffer.hpp>
|
|
|
|
#include <algorithm>
|
|
#include <iterator>
|
|
#include <vector>
|
|
|
|
namespace llarp
|
|
{
|
|
namespace service
|
|
{
|
|
struct PendingBuffer
|
|
{
|
|
std::vector<byte_t> payload;
|
|
ProtocolType protocol;
|
|
|
|
PendingBuffer(const llarp_buffer_t& buf, ProtocolType t) : payload(buf.sz), protocol(t)
|
|
{
|
|
std::copy(buf.base, buf.base + buf.sz, std::back_inserter(payload));
|
|
}
|
|
|
|
ManagedBuffer
|
|
Buffer()
|
|
{
|
|
return ManagedBuffer{llarp_buffer_t(payload)};
|
|
}
|
|
};
|
|
} // namespace service
|
|
|
|
} // namespace llarp
|
|
|
|
#endif
|