Ensure backwards compatibility before modifying protocol

This change makes sure that things work smoothly when "we" are a newer
version than our peer and have more fields in our messages than they do.
Missing fields will be left at zero/nil.

(The other side will ignore our extra fields, for the same effect.)
This commit is contained in:
Jakob Borg
2015-01-08 14:21:58 +01:00
parent 2a58ca7697
commit ce3e6e084c
3 changed files with 31 additions and 1 deletions

View File

@@ -154,6 +154,10 @@ func (e XDRError) Error() string {
return "xdr " + e.op + ": " + e.err.Error()
}
func (e XDRError) IsEOF() bool {
return e.err == io.EOF
}
func (r *Reader) Error() error {
if r.err == nil {
return nil