mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
pool: fix panic caused by sending to closed channel, fix #237
This commit is contained in:
parent
92daa45b68
commit
f9a0d891a1
@ -445,6 +445,12 @@ func (p *ProxyServer) getWorkConn() (workConn *conn.Conn, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *ProxyServer) connectionPoolManager(closeCh <-chan struct{}) {
|
func (p *ProxyServer) connectionPoolManager(closeCh <-chan struct{}) {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
log.Warn("ProxyName [%s], connectionPoolManager panic %v", p.Name, r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
// check if we need more work connections and send messages to frpc to get more
|
// check if we need more work connections and send messages to frpc to get more
|
||||||
time.Sleep(time.Duration(2) * time.Second)
|
time.Sleep(time.Duration(2) * time.Second)
|
||||||
|
Loading…
Reference in New Issue
Block a user