Skip to content

Commit

Permalink
Fix chunking of ACL reads. (project-chip#22267)
Browse files Browse the repository at this point in the history
The chunking mechanism relies on errors being propagated as-is from the encoder
to the caller of AttributeAccessInterface::Read.  So we don't want to do any
error mapping on the read errors, unlike write errors.
  • Loading branch information
bzbarsky-apple authored and isiu-apple committed Sep 16, 2022
1 parent 6a2fddb commit 9834521
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,11 @@ CHIP_ERROR ChipErrorToImErrorMap(CHIP_ERROR err)

CHIP_ERROR AccessControlAttribute::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
return ChipErrorToImErrorMap(ReadImpl(aPath, aEncoder));
// Note: We are not generating any errors under ReadImpl ourselves; it's
// just the IM encoding machinery that does it. And we should propagate
// those errors through as-is, without mapping them to other errors, because
// they are used to communicate various state within said enoding machinery.
return ReadImpl(aPath, aEncoder);
}

CHIP_ERROR AccessControlAttribute::Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder)
Expand Down

0 comments on commit 9834521

Please sign in to comment.