mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 11:23:32 +02:00
XHTTP XMUX: Fix OpenUsage never gets reduced
Introduced in https://github.com/XTLS/Xray-core/pull/4163
This commit is contained in:
parent
cab2fdefd3
commit
1410b6335b
1 changed files with 2 additions and 2 deletions
|
@ -372,7 +372,7 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||
if xmuxClient2 != nil && xmuxClient2 != xmuxClient {
|
||||
xmuxClient2.OpenUsage.Add(1)
|
||||
}
|
||||
var once atomic.Int32
|
||||
var closed atomic.Int32
|
||||
|
||||
conn := splitConn{
|
||||
writer: writer,
|
||||
|
@ -380,7 +380,7 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||
remoteAddr: remoteAddr,
|
||||
localAddr: localAddr,
|
||||
onClose: func() {
|
||||
if once.Add(-1) < 0 {
|
||||
if closed.Add(1) > 1 {
|
||||
return
|
||||
}
|
||||
if xmuxClient != nil {
|
||||
|
|
Loading…
Reference in a new issue