mirror of
https://gitee.com/IrisVega/frp.git
synced 2024-11-01 22:31:29 +08:00
prevent sending on a closed channel in vhost package, fix #502
This commit is contained in:
parent
1e905839f0
commit
ad858a0d32
@ -18,6 +18,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/fatedier/frp/utils/errors"
|
||||
"github.com/fatedier/frp/utils/log"
|
||||
frpNet "github.com/fatedier/frp/utils/net"
|
||||
)
|
||||
@ -162,7 +163,12 @@ func (v *VhostMuxer) handle(c frpNet.Conn) {
|
||||
c = sConn
|
||||
|
||||
l.Debug("get new http request host [%s] path [%s]", name, path)
|
||||
err = errors.PanicToError(func() {
|
||||
l.accept <- c
|
||||
})
|
||||
if err != nil {
|
||||
l.Warn("listener is already closed, ignore this request")
|
||||
}
|
||||
}
|
||||
|
||||
type Listener struct {
|
||||
|
Loading…
Reference in New Issue
Block a user