#pragma once #include #include #include #include #include #include namespace vls { struct FrameLimits { std::size_t header_bytes{8192}; std::size_t body_bytes{16777216}; }; // A disengaged optional means EOF between frames. Framing errors are fatal: the // caller must not attempt to find another frame in an untrusted byte stream. [[nodiscard]] std::expected, std::string> read_frame(std::istream &input, FrameLimits limits = {}); [[nodiscard]] std::expected write_frame(std::ostream &output, std::string_view body); } // namespace vls