Skip to content

Commit 45521d5

Browse files
author
刘河
committed
Exit bug、web display
1 parent 89f1e72 commit 45521d5

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

client/control.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
211211
if err != nil {
212212
return nil, err
213213
}
214+
connection.SetDeadline(time.Now().Add(time.Second * 10))
215+
defer connection.SetDeadline(time.Time{})
214216
c := conn.NewConn(connection)
215217
if _, err := c.Write([]byte(common.CONN_TEST)); err != nil {
216218
return nil, err
@@ -220,7 +222,7 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
220222
}
221223
if b, err := c.GetShortContent(32); err != nil || crypt.Md5(version.GetVersion()) != string(b) {
222224
logs.Error("The client does not match the server version. The current version of the client is", version.GetVersion())
223-
os.Exit(0)
225+
return nil, err
224226
}
225227
if _, err := c.Write([]byte(common.Getverifyval(vkey))); err != nil {
226228
return nil, err

lib/file/db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (s *DbUtils) GetClientList(start, length int, search, sort, order string, c
6464
}
6565
cnt++
6666
if start--; start < 0 {
67-
if length--; length > 0 {
67+
if length--; length >= 0 {
6868
list = append(list, v)
6969
}
7070
}
@@ -187,7 +187,7 @@ func (s *DbUtils) GetHost(start, length int, id int, search string) ([]*Host, in
187187
if id == 0 || v.Client.Id == id {
188188
cnt++
189189
if start--; start < 0 {
190-
if length--; length > 0 {
190+
if length--; length >= 0 {
191191
list = append(list, v)
192192
}
193193
}

lib/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package version
22

3-
const VERSION = "0.22.4"
3+
const VERSION = "0.22.5"
44

55
// Compulsory minimum version, Minimum downward compatibility to this version
66
func GetVersion() string {

server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func GetTunnel(start, length int, typeVal string, clientId int, search string) (
242242
v.Client.IsConnect = false
243243
}
244244
if start--; start < 0 {
245-
if length--; length > 0 {
245+
if length--; length >= 0 {
246246
if _, ok := RunList[v.Id]; ok {
247247
v.RunStatus = true
248248
} else {

0 commit comments

Comments
 (0)