You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2026/10/14 21:53:00 UTC

[jira] [Created] (THRIFT-6410) Dart protocol factories cannot pass maxStringSize to the protocols they create

Jens Geyer created THRIFT-6410:
----------------------------------

             Summary: Dart protocol factories cannot pass maxStringSize to the protocols they create
                 Key: THRIFT-6410
                 URL: https://issues.apache.org/jira/browse/THRIFT-6410
             Project: Thrift
          Issue Type: Improvement
          Components: Dart - Library
            Reporter: Jens Geyer


{{TBinaryProtocol}}, {{TCompactProtocol}} and {{TJsonProtocol}} take a {{maxStringSize}} constructor argument, but their factories have no such setting: {{TBinaryProtocolFactory.getProtocol()}} passes {{strictRead}} and {{strictWrite}} only, and {{TCompactProtocolFactory}} and {{TJsonProtocolFactory}} pass the transport only. A protocol obtained from a factory therefore always reads with the default limit ({{defaultMaxStringSize}}, 16384000). That includes the protocols {{TDeserializer}} and {{TMessageReader}} create, since both are given a factory; to use another limit with them takes a factory class of one's own.

The Python, Java and C++ protocol factories take the string limit and pass it on, e.g. {{TBinaryProtocolFactory(string_length_limit=...)}} in Python and {{TBinaryProtocol.Factory(stringLengthLimit, containerLengthLimit)}} in Java. THRIFT-6295 collects the same kind of gap for the container-size limit in other bindings.

Proposed change: give the three factories an optional {{maxStringSize}} parameter, defaulting to {{defaultMaxStringSize}}, and pass it to the protocols they create.

_Drafted with AI assistance (Claude Opus 5.5); reviewed and filed by Jens Geyer._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)