| 1281 | |
| 1282 | template <typename MessagePtr> |
| 1283 | Result<MessagePtr> CheckBodyLength(MessagePtr message, const FileBlock& block) { |
| 1284 | if (message->body_length() != block.body_length) { |
| 1285 | return Status::Invalid( |
| 1286 | "Mismatching body length for IPC message " |
| 1287 | "(Block.bodyLength: ", |
| 1288 | block.body_length, " vs. Message.bodyLength: ", message->body_length(), ")"); |
| 1289 | } |
| 1290 | // NOTE: we cannot check metadata length as easily as we would have to account |
| 1291 | // for the additional IPC signalisation (such as optional continuation bytes). |
| 1292 | return message; |
| 1293 | } |
| 1294 | |
| 1295 | Result<std::unique_ptr<Message>> ReadMessageFromBlock( |
| 1296 | const FileBlock& block, io::RandomAccessFile* file, |
no test coverage detected