mirror of
https://github.com/openziti/desktop-edge-win.git
synced 2026-10-14 16:50:03 +00:00
fix as per code review comments
This commit is contained in:
@@ -467,11 +467,11 @@ func serveIpc(conn net.Conn) {
|
||||
log.Debug("pipe closed. client likely disconnected")
|
||||
} else {
|
||||
log.Errorf("unexpected error while reading line. %v", readErr)
|
||||
|
||||
//try to respond... likely won't work but try...
|
||||
respondWithError(enc, "could not read line properly! exiting loop!", UNKNOWN_ERROR, readErr)
|
||||
}
|
||||
}
|
||||
|
||||
//try to respond... likely won't work but try...
|
||||
respondWithError(enc, "connection closed due to shutdown request for ipc", UNKNOWN_ERROR, readErr)
|
||||
log.Debugf("connection closed due to shutdown request for ipc: %v", readErr)
|
||||
return
|
||||
}
|
||||
@@ -487,11 +487,12 @@ func serveIpc(conn net.Conn) {
|
||||
dec := json.NewDecoder(strings.NewReader(msg))
|
||||
var cmd dto.CommandMsg
|
||||
if cmdErr := dec.Decode(&cmd); cmdErr == io.EOF {
|
||||
break
|
||||
respondWithError(enc, "could not decode command properly", UNKNOWN_ERROR, cmdErr)
|
||||
continue
|
||||
} else if cmdErr != nil {
|
||||
log.Error(cmdErr)
|
||||
respondWithError(enc, "could not decode command properly", UNKNOWN_ERROR, cmdErr)
|
||||
break
|
||||
continue
|
||||
}
|
||||
|
||||
switch cmd.Function {
|
||||
@@ -506,6 +507,7 @@ func serveIpc(conn net.Conn) {
|
||||
|
||||
var newId dto.AddIdentity
|
||||
if err := addIdDec.Decode(&newId); err == io.EOF {
|
||||
respondWithError(enc, "could not decode string properly", UNKNOWN_ERROR, err)
|
||||
break
|
||||
} else if err != nil {
|
||||
log.Error(err)
|
||||
|
||||
Reference in New Issue
Block a user