[
https://issues.apache.org/jira/browse/THRIFT-6288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jens Geyer resolved THRIFT-6288.
--------------------------------
Fix Version/s: 0.25.0
Assignee: Jens Geyer
Resolution: Fixed
> Rust: the stale remaining-bytes TODO in check_container_size
> ------------------------------------------------------------
>
> Key: THRIFT-6288
> URL: https://issues.apache.org/jira/browse/THRIFT-6288
> Project: Thrift
> Issue Type: Improvement
> Components: Rust - Library
> Reporter: Jens Geyer
> Assignee: Jens Geyer
> Priority: Minor
> Fix For: 0.25.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> {{check_container_size}} in {{lib/rs/src/protocol/mod.rs}} carries a {{TODO}}
> saying a remaining-bytes check is still pending for transports that track
> exact remaining bytes:
> {code}
> // TODO: Add a check for the maximum number of bytes remaining in the buffer
> // for transports that track exact remaining bytes. For now, we use the
> message
> // size limit as an approximation.
> {code}
> No Rust transport reports remaining bytes -- {{TReadTransport}} is
> {{io::Read}}, which has no such notion -- so the note points at an approach
> the binding cannot take as written, and reads as an unfinished check when the
> limit is in fact the one that applies.
> h2. Suggested
> Either add a remaining-bytes notion to {{TReadTransport}} (a real API
> addition, parity with the transports in Go/Java/C++/netstd that do report it)
> or reword the comment to state that Rust bounds a container by the configured
> limit alone.
> _Drafted with AI assistance (Claude Opus 4.8); reviewed and filed by Jens
> Geyer._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)