cmd/frps: improve the description of login failed

This commit is contained in:
fatedier 2016-07-08 14:15:26 +08:00
parent e99357da4e
commit a4e051d494

View File

@ -69,11 +69,6 @@ func controlWorker(c *conn.Conn) {
// login when type is NewCtlConn or NewWorkConn
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 cliReq.Type != consts.NewWorkConn {
cliRes := &msg.ControlRes{
@ -84,7 +79,7 @@ func controlWorker(c *conn.Conn) {
byteBuf, _ := json.Marshal(cliRes)
err = c.Write(string(byteBuf) + "\n")
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)
return
}
@ -98,6 +93,12 @@ func controlWorker(c *conn.Conn) {
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
msgSendChan := make(chan interface{}, 1024)
go msgSender(s, c, msgSendChan)