mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
let max_pool_count valid
This commit is contained in:
parent
58745992ef
commit
e9e86fccf0
@ -137,6 +137,10 @@ func NewControl(rc *controller.ResourceController, pxyManager *proxy.ProxyManage
|
|||||||
statsCollector stats.Collector, ctlConn net.Conn, loginMsg *msg.Login,
|
statsCollector stats.Collector, ctlConn net.Conn, loginMsg *msg.Login,
|
||||||
serverCfg config.ServerCommonConf) *Control {
|
serverCfg config.ServerCommonConf) *Control {
|
||||||
|
|
||||||
|
poolCount := loginMsg.PoolCount
|
||||||
|
if poolCount > int(serverCfg.MaxPoolCount) {
|
||||||
|
poolCount = int(serverCfg.MaxPoolCount)
|
||||||
|
}
|
||||||
return &Control{
|
return &Control{
|
||||||
rc: rc,
|
rc: rc,
|
||||||
pxyManager: pxyManager,
|
pxyManager: pxyManager,
|
||||||
@ -145,9 +149,9 @@ func NewControl(rc *controller.ResourceController, pxyManager *proxy.ProxyManage
|
|||||||
loginMsg: loginMsg,
|
loginMsg: loginMsg,
|
||||||
sendCh: make(chan msg.Message, 10),
|
sendCh: make(chan msg.Message, 10),
|
||||||
readCh: make(chan msg.Message, 10),
|
readCh: make(chan msg.Message, 10),
|
||||||
workConnCh: make(chan net.Conn, loginMsg.PoolCount+10),
|
workConnCh: make(chan net.Conn, poolCount+10),
|
||||||
proxies: make(map[string]proxy.Proxy),
|
proxies: make(map[string]proxy.Proxy),
|
||||||
poolCount: loginMsg.PoolCount,
|
poolCount: poolCount,
|
||||||
portsUsedNum: 0,
|
portsUsedNum: 0,
|
||||||
lastPing: time.Now(),
|
lastPing: time.Now(),
|
||||||
runId: loginMsg.RunId,
|
runId: loginMsg.RunId,
|
||||||
|
Loading…
Reference in New Issue
Block a user