mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-21 21:19:49 +00: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
@ -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 New Issue
Block a user