mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-07-26 03:44:15 +00:00
Update session.go
This commit is contained in:
parent
b9a1eeb54c
commit
ec4f48d429
1 changed files with 2 additions and 2 deletions
|
@ -50,11 +50,11 @@ func (m *SessionManager) Count() int {
|
|||
return int(m.count)
|
||||
}
|
||||
|
||||
func (m *SessionManager) Allocate() *Session {
|
||||
func (m *SessionManager) Allocate(MaxConcurrency int) *Session {
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
if m.closed {
|
||||
if m.closed || (MaxConcurrency > 0 && len(m.sessions) >= MaxConcurrency) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue