[GitHub] thrift pull request #1375: THRIFT-4346: Allow ZlibTransportFactory to wrap o...
Github user asfgit closed the pull request at: https://github.com/apache/thrift/pull/1375 ---
[GitHub] thrift pull request #1375: THRIFT-4346: Allow ZlibTransportFactory to wrap o...
Github user dcelasun commented on a diff in the pull request: https://github.com/apache/thrift/pull/1375#discussion_r140900375 --- Diff: lib/go/thrift/zlib_transport.go --- @@ -39,12 +40,26 @@ type TZlibTransport struct { // GetTransport constructs a new instance of NewTZlibTransport func (p *TZlibTransportFactory) GetTransport(trans TTransport) (TTransport, error) { + if p.factory != nil { + // wrap other factory + var err error + trans, err = p.factory.GetTransport(trans) + if err != nil { + return nil, err + } + } return NewTZlibTransport(trans, p.level) } // NewTZlibTransportFactory constructs a new instance of NewTZlibTransportFactory func NewTZlibTransportFactory(level int) *TZlibTransportFactory { - return {level: level} + return {level: level, factory: nil} +} + +// NewTZlibTransportFactory constructs a new instance of NewTZlibTransportFactory --- End diff -- The second `NewTZlibTransportFactory` should be `TZlibTransportFactory` ---
[GitHub] thrift pull request #1375: THRIFT-4346: Allow ZlibTransportFactory to wrap o...
GitHub user ykhrustalev opened a pull request: https://github.com/apache/thrift/pull/1375 THRIFT-4346: Allow ZlibTransportFactory to wrap other factories It is a case for when zlib is used with conjunction to other transport, for example framed transport. You can merge this pull request into a Git repository by running: $ git pull https://github.com/swiftserve/thrift THRIFT-4346 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/1375.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1375 commit 6aaf908474e947399e80ee5d481fe4f1c678c64d Author: Yuri KhrustalevDate: 2017-09-25T20:22:33Z THRIFT-4346: Allow ZlibTransportFactory to wrap other factories It is a case for when zlib is used with conjunction to other transport, for example framed transport. ---