| 1266 | |
| 1267 | template <typename MessagePtr> |
| 1268 | Result<MessagePtr> CheckBodyLength(MessagePtr message, const FileBlock& block) { |
| 1269 | if (message->body_length() != block.body_length) { |
| 1270 | return Status::Invalid( |
| 1271 | "Mismatching body length for IPC message " |
| 1272 | "(Block.bodyLength: ", |
| 1273 | block.body_length, " vs. Message.bodyLength: ", message->body_length(), ")"); |
| 1274 | } |
| 1275 | // NOTE: we cannot check metadata length as easily as we would have to account |
| 1276 | // for the additional IPC signalisation (such as optional continuation bytes). |
| 1277 | return message; |
| 1278 | } |
| 1279 | |
| 1280 | Result<std::unique_ptr<Message>> ReadMessageFromBlock( |
| 1281 | const FileBlock& block, io::RandomAccessFile* file, |
no test coverage detected