mirror of https://github.com/ehang-io/nps
change exit to error when the vkey is not right
parent
f938b2fdd1
commit
a602b11270
|
@ -47,7 +47,7 @@ func (s *TRPClient) Start() {
|
||||||
retry:
|
retry:
|
||||||
c, err := NewConn(s.bridgeConnType, s.vKey, s.svrAddr, common.WORK_MAIN, s.proxyUrl)
|
c, err := NewConn(s.bridgeConnType, s.vKey, s.svrAddr, common.WORK_MAIN, s.proxyUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logs.Error("The connection server failed and will be reconnected in five seconds")
|
logs.Error("The connection server failed and will be reconnected in five seconds, error", err.Error())
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 5)
|
||||||
goto retry
|
goto retry
|
||||||
}
|
}
|
||||||
|
|
|
@ -241,8 +241,7 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
|
||||||
if s, err := c.ReadFlag(); err != nil {
|
if s, err := c.ReadFlag(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else if s == common.VERIFY_EER {
|
} else if s == common.VERIFY_EER {
|
||||||
logs.Error("Validation key %s incorrect", vkey)
|
return nil, errors.New(fmt.Sprintf("Validation key %s incorrect", vkey))
|
||||||
os.Exit(0)
|
|
||||||
}
|
}
|
||||||
if _, err := c.Write([]byte(connType)); err != nil {
|
if _, err := c.Write([]byte(connType)); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue