From b27fbb229dbe2a70095f1c15eff9fd1f193454e4 Mon Sep 17 00:00:00 2001
From: fangyincheng <fangyincheng@sina.com>
Date: Tue, 21 May 2019 19:40:05 +0800
Subject: [PATCH] Fix:problem about twoway

---
 protocol/dubbo/client.go     | 4 ++--
 protocol/dubbo/codec_test.go | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/protocol/dubbo/client.go b/protocol/dubbo/client.go
index b11dd686b..344cc67c7 100644
--- a/protocol/dubbo/client.go
+++ b/protocol/dubbo/client.go
@@ -229,9 +229,9 @@ func (c *Client) call(ct CallType, addr string, svcUrl common.URL, method string
 		rsp.reply = reply
 		rsp.callback = callback
 		rsp.opts = opts
+	} else {
+		p.Header.Type = hessian.PackageRequest
 	}
-	// todo: it must be PackageRequest because of hessian2, but it is twoway actually
-	p.Header.Type = hessian.PackageRequest
 
 	var (
 		err     error
diff --git a/protocol/dubbo/codec_test.go b/protocol/dubbo/codec_test.go
index 8c3e5b18d..7ae227379 100644
--- a/protocol/dubbo/codec_test.go
+++ b/protocol/dubbo/codec_test.go
@@ -58,7 +58,7 @@ func TestDubboPackage_MarshalAndUnmarshal(t *testing.T) {
 	pkgres.Body = make([]interface{}, 7)
 	err = pkgres.Unmarshal(data)
 	assert.NoError(t, err)
-	assert.Equal(t, hessian.PackageRequest|hessian.PackageRequest_TwoWay, pkgres.Header.Type)
+	assert.Equal(t, hessian.PackageRequest, pkgres.Header.Type)
 	assert.Equal(t, byte(S_Dubbo), pkgres.Header.SerialID)
 	assert.Equal(t, int64(10086), pkgres.Header.ID)
 	assert.Equal(t, "2.5.4", pkgres.Body.([]interface{})[0])
-- 
GitLab