mirror of
https://github.com/zhigang1992/cow.git
synced 2026-01-12 17:12:57 +08:00
Sleep on error in accept loop.
Avoid flood of error logs upon too many open file error on Linux.
This commit is contained in:
2
proxy.go
2
proxy.go
@@ -169,6 +169,7 @@ func (hp *httpProxy) Serve(wg *sync.WaitGroup) {
|
||||
if isErrTooManyOpenFd(err) {
|
||||
connPool.CloseAll()
|
||||
}
|
||||
time.Sleep(time.Millisecond)
|
||||
continue
|
||||
}
|
||||
c := newClientConn(conn, hp)
|
||||
@@ -221,6 +222,7 @@ func (cp *cowProxy) Serve(wg *sync.WaitGroup) {
|
||||
if isErrTooManyOpenFd(err) {
|
||||
connPool.CloseAll()
|
||||
}
|
||||
time.Sleep(time.Millisecond)
|
||||
continue
|
||||
}
|
||||
ssConn := ss.NewConn(conn, cp.cipher.Copy())
|
||||
|
||||
Reference in New Issue
Block a user