This is an automated email from the ASF dual-hosted git repository.

fangyc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/master by this push:
     new 129f6bd  Update readwriter.go
     new 111e58c  Merge pull request #199 from JamesYaoh/master
129f6bd is described below

commit 129f6bdc49c207201c0e0786236fb5df8c9acbb4
Author: James Yao <39047217+jamesy...@users.noreply.github.com>
AuthorDate: Wed Sep 11 17:08:51 2019 +0800

    Update readwriter.go
    
    update Service.Interface to have default value Service.Path
---
 protocol/dubbo/readwriter.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/protocol/dubbo/readwriter.go b/protocol/dubbo/readwriter.go
index 8c6c8a5..137f3d4 100644
--- a/protocol/dubbo/readwriter.go
+++ b/protocol/dubbo/readwriter.go
@@ -140,10 +140,14 @@ func (p *RpcServerPackageHandler) Read(ss getty.Session, 
data []byte) (interface
                        if req[6] != nil {
                                attachments = 
req[6].(map[interface{}]interface{})
                        }
-                       pkg.Service.Interface = 
attachments[constant.INTERFACE_KEY].(string)
                        if pkg.Service.Path == "" && 
attachments[constant.PATH_KEY] != nil {
                                pkg.Service.Path = 
attachments[constant.PATH_KEY].(string)
                        }
+                       if _, ok := attachments[constant.INTERFACE_KEY]; ok {
+                               pkg.Service.Interface = 
attachments[constant.INTERFACE_KEY].(string)
+                       } else {
+                               pkg.Service.Interface = pkg.Service.Path
+                       }
                        if attachments[constant.GROUP_KEY] != nil {
                                pkg.Service.Group = 
attachments[constant.GROUP_KEY].(string)
                        }

Reply via email to