Decode a msgpack `bin` value into `out`. Returns true on success. The nomadnet response delivered to on_response by microReticulum is the msgpack-encoded `response` value from the server-side `umsgpack.packb([request_id, response])` envelope. nomadnet's serve_page returns Python `bytes`, which always serializes as msgpack `bin` — so unwrapping with bin_t is sufficient for the NomadNet us
| 210 | // NomadNet use case. (Mirrors the same Unpacker pattern that |
| 211 | // Link.cpp:1251-1255 uses to decode single-packet RESPONSE envelopes.) |
| 212 | static bool msgpack_unwrap_bin(const RNS::Bytes& packed, RNS::Bytes& out) { |
| 213 | if (packed.size() < 1) return false; |
| 214 | MsgPack::Unpacker u; |
| 215 | u.feed(packed.data(), packed.size()); |
| 216 | if (!u.isBin()) return false; |
| 217 | MsgPack::bin_t<uint8_t> bin; |
| 218 | u.deserialize(bin); |
| 219 | out = RNS::Bytes(bin.data(), bin.size()); |
| 220 | return true; |
| 221 | } |
| 222 | |
| 223 | // Write the raw response bytes (which we couldn't parse cleanly) to a |
| 224 | // temp file. Returns the file path on success, empty string on failure. |
no test coverage detected