all: new feature connection pool

This commit is contained in:
fatedier
2016-07-29 23:08:00 +08:00
parent fd6b94908b
commit 8f5f0b0a9a
11 changed files with 170 additions and 35 deletions

View File

@@ -142,6 +142,7 @@ func loginToServer(cli *client.ProxyClient) (c *conn.Conn, err error) {
ProxyName: cli.Name,
UseEncryption: cli.UseEncryption,
UseGzip: cli.UseGzip,
PoolCount: cli.PoolCount,
PrivilegeMode: cli.PrivilegeMode,
ProxyType: cli.Type,
Timestamp: nowTime,
@@ -181,7 +182,7 @@ func loginToServer(cli *client.ProxyClient) (c *conn.Conn, err error) {
return c, fmt.Errorf("%s", ctlRes.Msg)
}
log.Debug("ProxyName [%s], connect to server [%s:%d] success!", cli.Name, client.ServerAddr, client.ServerPort)
log.Info("ProxyName [%s], connect to server [%s:%d] success!", cli.Name, client.ServerAddr, client.ServerPort)
return
}
@@ -199,5 +200,5 @@ func heartbeatSender(c *conn.Conn, msgSendChan chan interface{}) {
break
}
}
log.Debug("Heartbeat goroutine exit")
log.Info("Heartbeat goroutine exit")
}

View File

@@ -276,6 +276,13 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) {
// set infomations from frpc
s.UseEncryption = req.UseEncryption
s.UseGzip = req.UseGzip
if req.PoolCount > server.MaxPoolCount {
s.PoolCount = server.MaxPoolCount
} else if req.PoolCount < 0 {
s.PoolCount = 0
} else {
s.PoolCount = req.PoolCount
}
// start proxy and listen for user connections, no block
err := s.Start(c)