mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
udp proxy: fix #652
This commit is contained in:
parent
9e8980429f
commit
e9241aeb94
@ -82,6 +82,7 @@ func Forwarder(dstAddr *net.UDPAddr, readCh <-chan *msg.UdpPacket, sendCh chan<-
|
|||||||
mu.Lock()
|
mu.Lock()
|
||||||
delete(udpConnMap, addr)
|
delete(udpConnMap, addr)
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
|
udpConn.Close()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
buf := pool.GetBuf(1500)
|
buf := pool.GetBuf(1500)
|
||||||
|
@ -265,13 +265,14 @@ func (ctl *Control) stoper() {
|
|||||||
ctl.conn.Close()
|
ctl.conn.Close()
|
||||||
ctl.readerShutdown.WaitDone()
|
ctl.readerShutdown.WaitDone()
|
||||||
|
|
||||||
|
ctl.mu.Lock()
|
||||||
|
defer ctl.mu.Unlock()
|
||||||
|
|
||||||
close(ctl.workConnCh)
|
close(ctl.workConnCh)
|
||||||
for workConn := range ctl.workConnCh {
|
for workConn := range ctl.workConnCh {
|
||||||
workConn.Close()
|
workConn.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl.mu.Lock()
|
|
||||||
defer ctl.mu.Unlock()
|
|
||||||
for _, pxy := range ctl.proxies {
|
for _, pxy := range ctl.proxies {
|
||||||
pxy.Close()
|
pxy.Close()
|
||||||
ctl.svr.DelProxy(pxy.GetName())
|
ctl.svr.DelProxy(pxy.GetName())
|
||||||
@ -303,6 +304,7 @@ func (ctl *Control) manager() {
|
|||||||
if time.Since(ctl.lastPing) > time.Duration(config.ServerCommonCfg.HeartBeatTimeout)*time.Second {
|
if time.Since(ctl.lastPing) > time.Duration(config.ServerCommonCfg.HeartBeatTimeout)*time.Second {
|
||||||
ctl.conn.Warn("heartbeat timeout")
|
ctl.conn.Warn("heartbeat timeout")
|
||||||
ctl.allShutdown.Start()
|
ctl.allShutdown.Start()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
case rawMsg, ok := <-ctl.readCh:
|
case rawMsg, ok := <-ctl.readCh:
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
Reference in New Issue
Block a user