fix bug causing empty strings to be become non-nil errors on client side of rpc connection.

R=rsc
CC=golang-dev
https://golang.org/cl/155078
This commit is contained in:
Rob Pike 2009-11-16 23:32:16 -08:00
parent bcb46c8560
commit 50c04132ac
2 changed files with 9 additions and 2 deletions

View file

@ -276,7 +276,9 @@ func sendResponse(sending *sync.Mutex, req *Request, reply interface{}, enc *gob
resp := new(Response);
// Encode the response header
resp.ServiceMethod = req.ServiceMethod;
resp.Error = errmsg;
if errmsg != "" {
resp.Error = errmsg
}
resp.Seq = req.Seq;
sending.Lock();
enc.Encode(resp);