Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Verify rsync protocol version match prior to proceeding - Rebased on current master. #71

Merged
merged 7 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update [vV]ersion comment strings; remove extraneous error check.
  • Loading branch information
stephenwithav committed Jul 2, 2020
commit e8abef25061e41f355f7f4b05f08f0e3e9ce6dd5
2 changes: 1 addition & 1 deletion cmd/coder/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (cmd *syncCmd) RegisterFlags(fl *pflag.FlagSet) {
fl.BoolVarP(&cmd.init, "init", "i", false, "do initial transfer and exit")
}

// Returns local rsync protocol version as a string.
// version returns local rsync protocol version as a string.
func (_ *syncCmd) version() string {
cmd := exec.Command("rsync", "--version")
out, err := cmd.CombinedOutput()
Expand Down
5 changes: 1 addition & 4 deletions internal/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const (
maxAcceptableDispatch = time.Millisecond * 50
)

// Returns remote protocol version as a string.
// Version returns remote protocol version as a string.
// Or, an error if one exists.
func (s Sync) Version() (string, error) {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
Expand All @@ -287,9 +287,6 @@ func (s Sync) Version() (string, error) {
io.Copy(buf, process.Stdout())

err = process.Wait()
if _, ok := err.(wsep.ExitError); ok {
return "", err
}
if err != nil {
return "", err
}
Expand Down