This is an automated email from the ASF dual-hosted git repository.
baerwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/main by this push:
new 95370b405 Fix: After the streaming call ends, client response.tailer()
returns empty (#2658)
95370b405 is described below
commit 95370b405d13ba35f1dec1afff08f9e032bced9e
Author: YarBor <[email protected]>
AuthorDate: Fri May 10 19:38:46 2024 +0800
Fix: After the streaming call ends, client response.tailer() returns empty
(#2658)
* fix : fix_StreamCall_Tailer
Signed-off-by: YarBor <[email protected]>
* fix ci
Signed-off-by: YarBor <[email protected]>
---------
Signed-off-by: YarBor <[email protected]>
Co-authored-by: YarBor <[email protected]>
---
protocol/triple/triple_protocol/protocol_grpc.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/protocol/triple/triple_protocol/protocol_grpc.go
b/protocol/triple/triple_protocol/protocol_grpc.go
index f52cf0e54..1a99c45e2 100644
--- a/protocol/triple/triple_protocol/protocol_grpc.go
+++ b/protocol/triple/triple_protocol/protocol_grpc.go
@@ -406,7 +406,14 @@ func (cc *grpcClientConn) ResponseTrailer() http.Header {
}
func (cc *grpcClientConn) CloseResponse() error {
- return cc.duplexCall.CloseRead()
+ err := cc.duplexCall.CloseRead()
+ if err != nil {
+ return err
+ }
+ if cc.duplexCall.response != nil && cc.duplexCall.response.Trailer !=
nil {
+ cc.responseTrailer = cc.duplexCall.response.Trailer.Clone()
+ }
+ return nil
}
func (cc *grpcClientConn) validateResponse(response *http.Response) *Error {