fix closing
This commit is contained in:
@@ -92,13 +92,14 @@ func (c Config) Close() {
|
||||
for i := range c.forwards {
|
||||
if c.forwards[i] != nil {
|
||||
i := i
|
||||
go func() {
|
||||
func() {
|
||||
c.forwards[i].New = nil
|
||||
for {
|
||||
got := c.forwards[i].Get()
|
||||
if got != nil {
|
||||
go got.(net.Conn).Close()
|
||||
if got == nil {
|
||||
break
|
||||
}
|
||||
got.(net.Conn).Close()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user