aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-12 10:15:23 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-12-12 10:15:23 +0100
commit273743466fa39a14bf7abf73f30427406684f3d3 (patch)
treedfdc7f8bcaddcaf69534f4b16052944767a7feb5 /main.go
parent752d0492fa653f8485f38b9f6d9a60a3145fd119 (diff)
Fixed crash on xds-agent or server disconnection (IOT-108)
Diffstat (limited to 'main.go')
-rw-r--r--main.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.go b/main.go
index 3df9e1a..f7db365 100644
--- a/main.go
+++ b/main.go
@@ -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())