Jens-G opened a new pull request, #3861:
URL: https://github.com/apache/thrift/pull/3861

   JIRA: [THRIFT-6263](https://issues.apache.org/jira/browse/THRIFT-6263)
   Client: go
   
   `NewTFramedTransportFactoryConf` and `NewTHeaderTransportFactoryConf` take a 
`TConfiguration`. `TZlibTransportFactory` had no such constructor, so a caller 
that builds its transport stack from configured factories had to handle zlib 
separately. A limit meant for the zlib transport, such as the `MaxMessageSize` 
it applies to decompressed data, could reach that transport only through a 
protocol.
   
   Changes in `lib/go/thrift/zlib_transport.go`:
   - `NewTZlibTransportFactoryConf(level, factory, conf)` follows the framed 
factory and passes `conf` to:
     - the wrapped factory;
     - the transport handed to `GetTransport`;
     - every `TZlibTransport` it makes.
   - `TZlibTransportFactory` implements `TConfigurationSetter`, so 
`PropagateTConfiguration` reaches it and the factory it wraps.
   - `NewTZlibTransportConf(trans, level, conf)` is the matching transport 
constructor, like `NewTFramedTransportConf` and `NewTHeaderTransportConf`.
   - `NewTZlibTransportFactory` and `NewTZlibTransportFactoryWithFactory` are 
unchanged: their transports carry no configuration, as before.
   
   ### Tests
   
   New cases in `zlib_transport_test.go`:
   - **Round trip** through a transport from the new factory.
   - **Configured limit:** a `MaxMessageSize` set on the factory is the one its 
transport applies when decompressing.
   - **Propagation:**
     - at construction, the configuration reaches the wrapped factory;
     - in `GetTransport`, it reaches the transport handed in, the wrapped 
transport and the zlib transport;
     - after `PropagateTConfiguration` on the factory, it reaches the wrapped 
factory and the next transport.
   - **Existing constructors** still leave the configuration unset.
   
   Checks:
   - Removing each of the five new propagation steps in turn fails a case.
   - `go vet -stdmethods=false` and `go test -race ./thrift` pass with Go 1.26 
and 1.27.
   - `GOARCH=386` vet and tests pass as well.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to