commit | 68daa72bb4ac9a8f13fcddd19eb405077cd02a52 | [log] [tgz] |
---|---|---|
author | Wyatt Hepler <hepler@google.com> | Thu Jul 15 17:10:15 2021 -0700 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jul 16 22:39:44 2021 +0000 |
tree | e0ce74dd661dbd81edcbb1fbcaa5dc1f165728a1 | |
parent | 5f15bfd071edb140fdf3aa9eb4f50313463d4dd6 [diff] |
pw_rpc: Fix responding with empty buffers The Channel::OutputBuffer::Contains() method previously did not check if the OutputBuffer itself was empty. An empty span sent as a raw response would appear as a span within the OutputBuffer, even though the OutputBuffer was never allocated. Instead of allocating an OutputBuffer for the RPC packet, the responder would attempt to encode it into the empty OutputBuffer, which would fail. - Update Contains() so it returns false on an empty OutputBuffer. - Add tests for OutputBuffer::Contains() and sending an empty response. Change-Id: I089944079655ed6c21f40c8f19c1d94b942ebdd8 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/53420 Reviewed-by: Alexei Frolov <frolv@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com>
See our website: http://pigweed.dev