mirror of
https://github.com/duanhf2012/origin.git
synced 2026-05-21 00:37:31 +08:00
优化变量名称
This commit is contained in:
@@ -151,7 +151,7 @@ type RpcResponse struct {
|
|||||||
Err *RpcError
|
Err *RpcError
|
||||||
|
|
||||||
//returns
|
//returns
|
||||||
Returns []byte
|
Reply []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -179,14 +179,15 @@ func (slf *Client) Run(){
|
|||||||
delete(slf.pending,respone.Seq)
|
delete(slf.pending,respone.Seq)
|
||||||
slf.pendingLock.Unlock()
|
slf.pendingLock.Unlock()
|
||||||
v.Err = nil
|
v.Err = nil
|
||||||
//*****如果对方返回nil,测试跨node时,调用其他服务rpc不存在的情况
|
|
||||||
if len(respone.Returns) >0 {
|
if len(respone.Reply) >0 {
|
||||||
err = processor.Unmarshal(respone.Returns,v.Reply)
|
err = processor.Unmarshal(respone.Reply,v.Reply)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("rpcClient Unmarshal body error,error:%+v",err)
|
log.Error("rpcClient Unmarshal body error,error:%+v",err)
|
||||||
v.Err = err
|
v.Err = err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if respone.Err != nil {
|
if respone.Err != nil {
|
||||||
v.Err= respone.Err
|
v.Err= respone.Err
|
||||||
}
|
}
|
||||||
@@ -194,10 +195,8 @@ func (slf *Client) Run(){
|
|||||||
if v.callback.IsValid() {
|
if v.callback.IsValid() {
|
||||||
v.rpcHandler.(*RpcHandler).callResponeCallBack<-v
|
v.rpcHandler.(*RpcHandler).callResponeCallBack<-v
|
||||||
}else{
|
}else{
|
||||||
//发送至接受者
|
|
||||||
v.done <- v
|
v.done <- v
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,8 +84,8 @@ func (agent *RpcAgent) WriteRespone(serviceMethod string,seq uint64,reply interf
|
|||||||
rpcRespone.Err = err
|
rpcRespone.Err = err
|
||||||
var errM error
|
var errM error
|
||||||
if reply!=nil {
|
if reply!=nil {
|
||||||
rpcRespone.Returns,errM = processor.Marshal(reply)
|
rpcRespone.Reply,errM = processor.Marshal(reply)
|
||||||
if errM!= nil {
|
if errM != nil {
|
||||||
rpcRespone.Err = ConvertError(errM)
|
rpcRespone.Err = ConvertError(errM)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user