Jens Geyer created THRIFT-6308:
----------------------------------
Summary: Align the meaning of a zero/unset wire-length limit
across bindings
Key: THRIFT-6308
URL: https://issues.apache.org/jira/browse/THRIFT-6308
Project: Thrift
Issue Type: Improvement
Components: D - Library, JavaME - Library, Lua - Library, Smalltalk -
Library
Reporter: Jens Geyer
Fix For: 0.26.0
h2. Observation
The configurable string/container/frame length limits behave inconsistently
across bindings:
* D: a non-positive limit disables the check ({{limit > 0 && size > limit}});
zero is a documented escape hatch, and zero/negative is the value most likely
to be passed by accident.
* Java ME, Smalltalk: setting a non-positive limit raises immediately.
* Lua: the base check is always in force, with no way to disable it.
The error raised on an over-limit value also differs (Lua
{{INVALID_FRAME_SIZE}}; D {{CORRUPTED_DATA}} / {{SIZE_LIMIT}}; Smalltalk
{{sizeLimit}} / {{negativeSize}}), so a cross-binding caller cannot rely on a
single code.
h2. Suggestion
Settle on one meaning for a zero/unset limit and one error-code family, and
align the bindings. Separately, Smalltalk exposes a string cap but no
container-size cap; adding one would match the other bindings (its container
reads are lazy, one element at a time, so this is consistency rather than a
pressing gap).
_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)