commit | 770673f4cfd4f03d90e1dfbccbbf69be66dde0a3 | [log] [tgz] |
---|---|---|
author | Alexei Frolov <frolv@google.com> | Tue Oct 11 00:12:31 2022 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Oct 11 00:12:31 2022 +0000 |
tree | 8d7b71ebf65f3bd535fe0fc804ef74257e168866 | |
parent | c60af251ba2d91f77fdfbe7bdd9436187e1908bb [diff] |
pw_transfer: Use correct chunk ID when resource doesn't exist In transfer protocol v2, session IDs are assigned by the server. When a client sends its opening chunk, it does not yet know its session ID and expects a response that is identified by the resource ID it is trying to transfer. In response to an opening chunk from the client, the server looks up a handler for the requested resource. If one is not found, the transfer thread responds directly without assigning a context for the transfer. This direct response did not account for the initial session/resource ID discrepancy, instead sending its NOT_FOUND chunk with the newly assigned session ID of which the client had no knowledge. This updates the transfer thread to always use resource ID to identify an error in response to an opening chunk. In legacy protocol, the two are the same, whereas in v2, resource ID is expected. Bug: 252870476 Change-Id: Ia594286976e263b6a46cf0bc582a848122386471 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/113990 Commit-Queue: Alexei Frolov <frolv@google.com> Reviewed-by: Wyatt Hepler <hepler@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/.