mirror of
https://github.com/fatedier/frp.git
synced 2024-12-12 17:50:51 +01:00
fix ci
This commit is contained in:
parent
f645082d72
commit
941ac25648
2
Gopkg.lock
generated
2
Gopkg.lock
generated
@ -30,7 +30,7 @@
|
|||||||
"net/mux",
|
"net/mux",
|
||||||
"pool"
|
"pool"
|
||||||
]
|
]
|
||||||
revision = "416571c55dbc32e13ce82c301a2a4b5a48ad7309"
|
revision = "280fa74053dee5311c46094f4bdefbf76d3fcbe2"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "frp"
|
branch = "frp"
|
||||||
|
@ -122,8 +122,8 @@ func NewService() (svr *Service, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
svr.muxer = mux.NewMux()
|
svr.muxer = mux.NewMux(ln)
|
||||||
go svr.muxer.Serve(ln)
|
go svr.muxer.Serve()
|
||||||
ln = svr.muxer.DefaultListener()
|
ln = svr.muxer.DefaultListener()
|
||||||
|
|
||||||
svr.listener = frpNet.WrapLogListener(ln)
|
svr.listener = frpNet.WrapLogListener(ln)
|
||||||
|
10
vendor/github.com/fatedier/golib/net/mux/mux.go
generated
vendored
10
vendor/github.com/fatedier/golib/net/mux/mux.go
generated
vendored
@ -43,8 +43,9 @@ type Mux struct {
|
|||||||
mu sync.RWMutex
|
mu sync.RWMutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMux() (mux *Mux) {
|
func NewMux(ln net.Listener) (mux *Mux) {
|
||||||
mux = &Mux{
|
mux = &Mux{
|
||||||
|
ln: ln,
|
||||||
lns: make([]*listener, 0),
|
lns: make([]*listener, 0),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -123,15 +124,12 @@ func (mux *Mux) copyLns() []*listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Serve handles connections from ln and multiplexes then across registered listeners.
|
// Serve handles connections from ln and multiplexes then across registered listeners.
|
||||||
func (mux *Mux) Serve(ln net.Listener) error {
|
func (mux *Mux) Serve() error {
|
||||||
mux.mu.Lock()
|
|
||||||
mux.ln = ln
|
|
||||||
mux.mu.Unlock()
|
|
||||||
for {
|
for {
|
||||||
// Wait for the next connection.
|
// Wait for the next connection.
|
||||||
// If it returns a temporary error then simply retry.
|
// If it returns a temporary error then simply retry.
|
||||||
// If it returns any other error then exit immediately.
|
// If it returns any other error then exit immediately.
|
||||||
conn, err := ln.Accept()
|
conn, err := mux.ln.Accept()
|
||||||
if err, ok := err.(interface {
|
if err, ok := err.(interface {
|
||||||
Temporary() bool
|
Temporary() bool
|
||||||
}); ok && err.Temporary() {
|
}); ok && err.Temporary() {
|
||||||
|
Loading…
Reference in New Issue
Block a user