From 4e531d3521918293273f550b302376602dd63766 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 18 Aug 2021 14:41:52 -0700 Subject: [PATCH] thrift/register: Provide RequestReader --- encoding/thrift/register.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/encoding/thrift/register.go b/encoding/thrift/register.go index 42bc4154f3..48ab67dcb0 100644 --- a/encoding/thrift/register.go +++ b/encoding/thrift/register.go @@ -95,10 +95,10 @@ func BuildProcedures(s Service, opts ...RegisterOption) []transport.Procedure { proto = rc.Protocol } - var streamProto stream.Protocol = binary.Default + var streamReqReader stream.RequestReader = binary.Default if rc.Protocol != nil && rc.NoWire { - if sp, ok := rc.Protocol.(stream.Protocol); ok { - streamProto = sp + if sp, ok := rc.Protocol.(stream.RequestReader); ok { + streamReqReader = sp } } @@ -116,8 +116,7 @@ func BuildProcedures(s Service, opts ...RegisterOption) []transport.Procedure { if rc.NoWire { spec = transport.NewUnaryHandlerSpec(thriftNoWireHandler{ NoWireHandler: method.HandlerSpec.NoWire, - Protocol: streamProto, - Enveloping: rc.Enveloping, + RequestReader: streamReqReader, }) } else { spec = transport.NewUnaryHandlerSpec(thriftUnaryHandler{ @@ -130,8 +129,7 @@ func BuildProcedures(s Service, opts ...RegisterOption) []transport.Procedure { if rc.NoWire { spec = transport.NewOnewayHandlerSpec(thriftNoWireHandler{ NoWireHandler: method.HandlerSpec.NoWire, - Protocol: streamProto, - Enveloping: rc.Enveloping, + RequestReader: streamReqReader, }) } else { spec = transport.NewOnewayHandlerSpec(thriftOnewayHandler{