From 043264ca77ffe13d4a2228c3c1ea905960ac7282 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 23 Aug 2013 11:27:59 -0700 Subject: [PATCH] communicator/ssh: more error handlingin Upload --- communicator/ssh/communicator.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 9d6570a94..6a10d2299 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -160,7 +160,10 @@ func (c *comm) Upload(path string, input io.Reader) error { return err } - io.Copy(w, input_memory) + if _, err := io.Copy(w, input_memory); err != nil{ + return err + } + fmt.Fprint(w, "\x00") err = checkSCPStatus(stdoutR) if err != nil {