commit | 08d5e68858f9e26e80fc431300ea91696f3dc066 | [log] [tgz] |
---|---|---|
author | Eli Lipsitz <elipsitz@google.com> | Wed May 01 16:03:05 2024 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed May 01 16:03:05 2024 +0000 |
tree | a3b08f404f6b585d1106886fa2c8069cdabeaaf6 | |
parent | b572538413b3dccf434f825a2d2d0484c0547599 [diff] |
pw_grpc: Support fragmented gRPC messages if an allocator is provided Previously, gRPC messages that were fragmented across multiple HTTP2 DATA frames were unsupported, as the reassembly process could require buffering up to the maximum message size *per stream*. This commit adds support for fragmented messages, taking in an optional pw::allocator::Allocator which is used to allocate a buffer for fragmented message reassembly. This allows consumers of pw_grpc to determine the fragmentation allocation strategy that works best for their purpose: e.g. by providing an allocator that allows a single message to be buffered at a time, or limits the total amount of additional overhead. Bug: b/323924487 Test: Using the Python gRPC library, which aggressively fragments messages when the flow control window is small, I sent a long stream of messages that got fragmented and successfully reassembled. Some of these messages fragmented the initial length-prefix too, which also worked correctly. Change-Id: Ie43ee0326ef38cbe826486bf07bec6ecc68d67af Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/204431 Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Reviewed-by: Austin Foxley <afoxley@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Eli Lipsitz <elipsitz@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.