[Yunq] Check identify byte and ensure users check status code.
This commit is contained in:
parent
7d9f9a7ae9
commit
3eba0bd9d8
21 changed files with 142 additions and 67 deletions
|
|
@ -25,7 +25,7 @@ glcr::Status ReadRequest::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_t
|
|||
}
|
||||
|
||||
glcr::Status ReadRequest::ParseFromBytesInternal(const glcr::ByteBuffer& bytes, uint64_t offset) {
|
||||
RETURN_ERROR(yunq::CheckHeader(bytes));
|
||||
RETURN_ERROR(yunq::CheckHeader(bytes, offset));
|
||||
// Parse device_id.
|
||||
set_device_id(bytes.At<uint64_t>(offset + header_size + (8 * 0)));
|
||||
// Parse lba.
|
||||
|
|
@ -79,7 +79,7 @@ glcr::Status ReadManyRequest::ParseFromBytes(const glcr::ByteBuffer& bytes, uint
|
|||
}
|
||||
|
||||
glcr::Status ReadManyRequest::ParseFromBytesInternal(const glcr::ByteBuffer& bytes, uint64_t offset) {
|
||||
RETURN_ERROR(yunq::CheckHeader(bytes));
|
||||
RETURN_ERROR(yunq::CheckHeader(bytes, offset));
|
||||
// Parse device_id.
|
||||
set_device_id(bytes.At<uint64_t>(offset + header_size + (8 * 0)));
|
||||
// Parse lba.
|
||||
|
|
@ -200,7 +200,7 @@ glcr::Status ReadResponse::ParseFromBytes(const glcr::ByteBuffer& bytes, uint64_
|
|||
}
|
||||
|
||||
glcr::Status ReadResponse::ParseFromBytesInternal(const glcr::ByteBuffer& bytes, uint64_t offset) {
|
||||
RETURN_ERROR(yunq::CheckHeader(bytes));
|
||||
RETURN_ERROR(yunq::CheckHeader(bytes, offset));
|
||||
// Parse device_id.
|
||||
set_device_id(bytes.At<uint64_t>(offset + header_size + (8 * 0)));
|
||||
// Parse size.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue