mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-06-08 03:59:11 -04:00
bug fixes
This commit is contained in:
@@ -63,10 +63,6 @@ func (m *ClientManager) onClientFinish() {
|
||||
m.access.Lock()
|
||||
defer m.access.Unlock()
|
||||
|
||||
if len(m.clients) < 10 {
|
||||
return
|
||||
}
|
||||
|
||||
activeClients := make([]*Client, 0, len(m.clients))
|
||||
|
||||
for _, client := range m.clients {
|
||||
@@ -158,8 +154,8 @@ func fetchInput(ctx context.Context, s *Session, output buf.Writer) {
|
||||
}
|
||||
|
||||
func (m *Client) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) bool {
|
||||
numSession := m.sessionManager.Size()
|
||||
if numSession >= int(m.concurrency) || numSession >= maxTotal {
|
||||
sm := m.sessionManager
|
||||
if sm.Size() >= int(m.concurrency) || sm.Count() >= maxTotal {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -169,7 +165,7 @@ func (m *Client) Dispatch(ctx context.Context, outboundRay ray.OutboundRay) bool
|
||||
default:
|
||||
}
|
||||
|
||||
s := m.sessionManager.Allocate()
|
||||
s := sm.Allocate()
|
||||
if s == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user