mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
cmd/frps: improve the description of login failed
This commit is contained in:
parent
e99357da4e
commit
a4e051d494
@ -69,11 +69,6 @@ func controlWorker(c *conn.Conn) {
|
|||||||
|
|
||||||
// login when type is NewCtlConn or NewWorkConn
|
// login when type is NewCtlConn or NewWorkConn
|
||||||
ret, info := doLogin(cliReq, c)
|
ret, info := doLogin(cliReq, c)
|
||||||
s, ok := server.ProxyServers[cliReq.ProxyName]
|
|
||||||
if !ok {
|
|
||||||
log.Warn("ProxyName [%s] is not exist", cliReq.ProxyName)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// if login type is NewWorkConn, nothing will be send to frpc
|
// if login type is NewWorkConn, nothing will be send to frpc
|
||||||
if cliReq.Type != consts.NewWorkConn {
|
if cliReq.Type != consts.NewWorkConn {
|
||||||
cliRes := &msg.ControlRes{
|
cliRes := &msg.ControlRes{
|
||||||
@ -84,7 +79,7 @@ func controlWorker(c *conn.Conn) {
|
|||||||
byteBuf, _ := json.Marshal(cliRes)
|
byteBuf, _ := json.Marshal(cliRes)
|
||||||
err = c.Write(string(byteBuf) + "\n")
|
err = c.Write(string(byteBuf) + "\n")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn("ProxyName [%s], write to client error, proxy exit", s.Name)
|
log.Warn("ProxyName [%s], write to client error, proxy exit", cliReq.ProxyName)
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -98,6 +93,12 @@ func controlWorker(c *conn.Conn) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s, ok := server.ProxyServers[cliReq.ProxyName]
|
||||||
|
if !ok {
|
||||||
|
log.Warn("ProxyName [%s], is not exist now", cliReq.ProxyName)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// create a channel for sending messages
|
// create a channel for sending messages
|
||||||
msgSendChan := make(chan interface{}, 1024)
|
msgSendChan := make(chan interface{}, 1024)
|
||||||
go msgSender(s, c, msgSendChan)
|
go msgSender(s, c, msgSendChan)
|
||||||
|
Loading…
Reference in New Issue
Block a user