Repository navigation
THRIFT-6459: Return a buffered transport from TBufferedTransportImpl.TFactory - #4060
Merged
Merged
Conversation
…TFactory Client: delphi TBufferedTransportImpl.TFactory.GetTransport() created a TFramedTransportImpl, so a server, TSerializer or TDeserializer set up with this factory read and wrote the framed format. It now creates a TBufferedTransportImpl over the transport's IStreamTransport interface and raises TTransportExceptionBadArgs for a transport that does not offer one. The serializer test now also runs the protocol conformity checks, which read the plain wire format, through the buffered transport factory, and a new test checks the transport classes that both factories return. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
THRIFT-6459
TBufferedTransportImpl.TFactory.GetTransport()created aTFramedTransportImpl, so a server,TSerializerorTDeserializerset up with this factory read and wrote the framed format. It now obtains the transport'sIStreamTransportinterface withSupports()and creates aTBufferedTransportImplover it.A transport without that interface cannot carry a
TBufferedTransportImpl, and the factory raisesTTransportExceptionBadArgsfor it. That includes a transport that is already buffered or framed. Returning such a transport unchanged would be the alternative, if that is preferred.Everything set up with this factory changes from the framed to the unframed format, so the ticket may want the Breaking-Change label.
Tests, in
lib/delphi/test/serializer/TestSerializer.Tests.pas:Test_TransportFactorieschecks that each factory returns the transport class it is named for, and that the buffered factory refuses a transport without a stream interface.Built with Delphi XE (Win32), with no compiler errors, warnings or hints.
TestSerializer.dprin both states:TTransportExceptionNotOpen: Cannot read, Remote side has closed, because the framed transport takes the first four bytes as a frame length;Test_TransportFactories,Test_COM_Types,Test_ThriftBytesCTORsandTest_Equal.In a throwaway build that skipped the serializer round trips,
Test_TransportFactoriesalone also failed on master, at the check of the class the buffered factory returns.🤖 Generated with Claude Code