[Yunq] Read capabilities using the parsing library.

This commit is contained in:
Drew Galbraith 2024-01-11 19:59:36 -08:00
parent 0e6aa532a1
commit 75d84a0fa5
7 changed files with 41 additions and 40 deletions

View file

@ -177,8 +177,7 @@ glcr::Status ReadResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_
yunq::MessageView message(bytes, offset);
RETURN_ERROR(ParseFromBytesInternal(message));
// Parse memory.
// FIXME: Implement in-buffer capabilities for inprocess serialization.
set_memory(0);
ASSIGN_OR_RETURN(memory_, message.ReadCapability(2));
return glcr::Status::Ok();
}
@ -186,9 +185,7 @@ glcr::Status ReadResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_
yunq::MessageView message(bytes, offset);
RETURN_ERROR(ParseFromBytesInternal(message));
// Parse memory.
uint64_t memory_ptr = bytes.At<uint64_t>(offset + header_size + (8 * 2));
set_memory(caps.At(memory_ptr));
ASSIGN_OR_RETURN(memory_, message.ReadCapability(2, caps));
return glcr::Status::Ok();
}