Skip to content

Commit

Permalink
net/control/Builder: add Add(ControlCommand) without payload
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jan 15, 2024
1 parent 5a0ab78 commit 77708bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/net/control/Builder.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public:
data.erase(4);
}

void Add(BengProxy::ControlCommand cmd) noexcept {
AppendT(BengProxy::ControlHeader{0U, ToBE16(uint16_t(cmd))});
}

void Add(BengProxy::ControlCommand cmd,
std::span<const std::byte> payload) noexcept {
AppendT(BengProxy::ControlHeader{ToBE16(payload.size()), ToBE16(uint16_t(cmd))});
Expand Down

0 comments on commit 77708bf

Please sign in to comment.