mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-23 22:04:49 +08:00
修复rpc error nil值问题
This commit is contained in:
@@ -178,6 +178,7 @@ func (slf *Client) Run(){
|
|||||||
}else {
|
}else {
|
||||||
delete(slf.pending,respone.Seq)
|
delete(slf.pending,respone.Seq)
|
||||||
slf.pendingLock.Unlock()
|
slf.pendingLock.Unlock()
|
||||||
|
v.Err = nil
|
||||||
//*****如果对方返回nil,测试跨node时,调用其他服务rpc不存在的情况
|
//*****如果对方返回nil,测试跨node时,调用其他服务rpc不存在的情况
|
||||||
if len(respone.Returns) >0 {
|
if len(respone.Returns) >0 {
|
||||||
err = processor.Unmarshal(respone.Returns,v.Reply)
|
err = processor.Unmarshal(respone.Returns,v.Reply)
|
||||||
|
|||||||
@@ -213,7 +213,12 @@ func (slf *Server) rpcHandlerGo(noReply bool,handlerName string,methodName strin
|
|||||||
|
|
||||||
if noReply == false {
|
if noReply == false {
|
||||||
req.requestHandle = func(Returns interface{},Err *RpcError){
|
req.requestHandle = func(Returns interface{},Err *RpcError){
|
||||||
pCall.Err = Err
|
if Err!=nil {
|
||||||
|
pCall.Err = Err
|
||||||
|
}else{
|
||||||
|
pCall.Err = nil
|
||||||
|
}
|
||||||
|
|
||||||
pCall.done <- pCall
|
pCall.done <- pCall
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,7 +250,12 @@ func (slf *Server) rpcHandlerAsyncGo(callerRpcHandler IRpcHandler,noReply bool,h
|
|||||||
|
|
||||||
if noReply == false {
|
if noReply == false {
|
||||||
req.requestHandle = func(Returns interface{},Err *RpcError){
|
req.requestHandle = func(Returns interface{},Err *RpcError){
|
||||||
pCall.Err = Err
|
if Err == nil {
|
||||||
|
pCall.Err = nil
|
||||||
|
}else{
|
||||||
|
pCall.Err = Err
|
||||||
|
}
|
||||||
|
|
||||||
if Returns!=nil {
|
if Returns!=nil {
|
||||||
pCall.Reply = Returns
|
pCall.Reply = Returns
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user