Skip to content

Commit

Permalink
Clarified that version tag components aren't sent over the wire.
Browse files Browse the repository at this point in the history
Version tag components are only useful for development work and
pre-releases. They are important for ensuring daemon API compatibility,
but they aren't useful for ensuring compatibility with endpoints.
  • Loading branch information
xenoscopic committed May 23, 2019
1 parent f09c570 commit 94565ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/mutagen/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func init() {
type versionBytes [12]byte

// SendVersion writes the current Mutagen version to the specified writer.
// Version tag components are neither transmitted nor received.
func SendVersion(writer io.Writer) error {
// Compute the version bytes.
var data versionBytes
Expand All @@ -51,7 +52,8 @@ func SendVersion(writer io.Writer) error {
return err
}

// ReceiveVersion reads version information from the specified reader.
// ReceiveVersion reads version information from the specified reader. Version
// tag components are neither transmitted nor received.
func ReceiveVersion(reader io.Reader) (uint32, uint32, uint32, error) {
// Read the bytes.
var data versionBytes
Expand All @@ -69,7 +71,9 @@ func ReceiveVersion(reader io.Reader) (uint32, uint32, uint32, error) {
}

// ReceiveAndCompareVersion reads version information from the specified reader
// and ensures that it matches the current Mutagen version.
// and ensures that it matches the current Mutagen version. Version tag
// components are neither transmitted nor received, so they do not enter into
// this comparison.
func ReceiveAndCompareVersion(reader io.Reader) (bool, error) {
// Receive the version.
major, minor, patch, err := ReceiveVersion(reader)
Expand Down

0 comments on commit 94565ad

Please sign in to comment.