mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-01 02:46:52 +00:00
multiple changes
This commit is contained in:
@@ -49,6 +49,11 @@ retry:
|
||||
time.Sleep(time.Second * 5)
|
||||
goto retry
|
||||
}
|
||||
if c == nil {
|
||||
logs.Error("Error data from server, and will be reconnected in five seconds")
|
||||
time.Sleep(time.Second * 5)
|
||||
goto retry
|
||||
}
|
||||
logs.Info("Successful connection with server %s", s.svrAddr)
|
||||
//monitor the connection
|
||||
go s.ping()
|
||||
|
@@ -223,8 +223,13 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
|
||||
if _, err := c.Write([]byte(crypt.Md5(version.GetVersion()))); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if b, err := c.GetShortContent(32); err != nil || crypt.Md5(version.GetVersion()) != string(b) {
|
||||
logs.Error("The client does not match the server version. The current version of the client is", version.GetVersion())
|
||||
b, err := c.GetShortContent(32)
|
||||
if err != nil {
|
||||
logs.Error(err)
|
||||
return nil, err
|
||||
}
|
||||
if crypt.Md5(version.GetVersion()) != string(b) {
|
||||
logs.Error("The client does not match the server version. The current core version of the client is", version.GetVersion())
|
||||
return nil, err
|
||||
}
|
||||
if _, err := c.Write([]byte(common.Getverifyval(vkey))); err != nil {
|
||||
|
Reference in New Issue
Block a user