communicator/ssh: more error handlingin Upload

This commit is contained in:
Mitchell Hashimoto 2013-08-23 11:27:59 -07:00
parent 99a7116939
commit 5a1073a980
1 changed files with 4 additions and 1 deletions

View File

@ -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 {