Rename error to code, update xdr path

This commit is contained in:
Audrius Butkevicius 2015-02-06 21:34:51 +00:00
parent fdf15f3ca3
commit bf7fea9a0a
2 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,6 @@
// Copyright (C) 2014 The Protocol Authors.
//go:generate -command genxdr go run ../syncthing/Godeps/_workspace/src/github.com/calmh/xdr/cmd/genxdr/main.go
//go:generate genxdr -o message_xdr.go message.go
package protocol
@ -78,8 +79,8 @@ type RequestMessage struct {
}
type ResponseMessage struct {
Data []byte
Error int32
Data []byte
Code int32
}
type ClusterConfigMessage struct {

View File

@ -465,13 +465,13 @@ ResponseMessage Structure:
\ Data (variable length) \
/ /
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error |
| Code |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
struct ResponseMessage {
opaque Data<>;
int Error;
int Code;
}
*/
@ -502,7 +502,7 @@ func (o ResponseMessage) AppendXDR(bs []byte) ([]byte, error) {
func (o ResponseMessage) EncodeXDRInto(xw *xdr.Writer) (int, error) {
xw.WriteBytes(o.Data)
xw.WriteUint32(uint32(o.Error))
xw.WriteUint32(uint32(o.Code))
return xw.Tot(), xw.Error()
}
@ -519,7 +519,7 @@ func (o *ResponseMessage) UnmarshalXDR(bs []byte) error {
func (o *ResponseMessage) DecodeXDRFrom(xr *xdr.Reader) error {
o.Data = xr.ReadBytes()
o.Error = int32(xr.ReadUint32())
o.Code = int32(xr.ReadUint32())
return xr.Error()
}