diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-12 10:15:23 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-12 10:15:23 +0100 |
commit | 273743466fa39a14bf7abf73f30427406684f3d3 (patch) | |
tree | dfdc7f8bcaddcaf69534f4b16052944767a7feb5 /main.go | |
parent | 752d0492fa653f8485f38b9f6d9a60a3145fd119 (diff) |
Fixed crash on xds-agent or server disconnection (IOT-108)
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -340,7 +340,13 @@ endloop: }) gdb.OnDisconnect(func(err error) { - fmt.Println("Disconnection: ", err.Error()) + errMsg := "\nXDS-Agent disconnected" + if err != nil { + fmt.Printf("%s: %v\n", errMsg, err.Error()) + } else { + fmt.Println(errMsg) + } + exitChan <- exitResult{err, int(syscall.ESHUTDOWN)} }) @@ -461,8 +467,8 @@ endloop: time.Sleep(time.Millisecond * 200) } - gdb.Write(command + "\n") log.Debugf("Send: <%v>", command) + gdb.Write(command + "\n") } log.Infof("Stdin scanner exit, close stdin (err=%v)", sc.Err()) |