[
https://issues.apache.org/jira/browse/THRIFT-4346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16179800#comment-16179800
]
ASF GitHub Bot commented on THRIFT-4346:
----------------------------------------
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 &TZlibTransportFactory{level: level}
+ return &TZlibTransportFactory{level: level, factory: nil}
+}
+
+// NewTZlibTransportFactory constructs a new instance of
NewTZlibTransportFactory
--- End diff --
The second `NewTZlibTransportFactory` should be `TZlibTransportFactory`
> Allow Zlib transport factory to wrap other transports
> -----------------------------------------------------
>
> Key: THRIFT-4346
> URL: https://issues.apache.org/jira/browse/THRIFT-4346
> Project: Thrift
> Issue Type: Improvement
> Components: Go - Library
> Affects Versions: 0.10.0
> Environment: Any
> Reporter: Yuri Khrustalev
> Priority: Minor
> Labels: easyfix
>
> Thrift protocol allows to combine number of transports to transfer data, one
> of the examples is to use zlib transport on top of the framed transport.
> Turns out there is no such factory which could help building one for zlib
> transport.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)