mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 05:29:50 +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 {
|
if xmuxClient2 != nil && xmuxClient2 != xmuxClient {
|
||||||
xmuxClient2.OpenUsage.Add(1)
|
xmuxClient2.OpenUsage.Add(1)
|
||||||
}
|
}
|
||||||
var once atomic.Int32
|
var closed atomic.Int32
|
||||||
|
|
||||||
conn := splitConn{
|
conn := splitConn{
|
||||||
writer: writer,
|
writer: writer,
|
||||||
@ -380,7 +380,7 @@ func Dial(ctx context.Context, dest net.Destination, streamSettings *internet.Me
|
|||||||
remoteAddr: remoteAddr,
|
remoteAddr: remoteAddr,
|
||||||
localAddr: localAddr,
|
localAddr: localAddr,
|
||||||
onClose: func() {
|
onClose: func() {
|
||||||
if once.Add(-1) < 0 {
|
if closed.Add(1) > 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if xmuxClient != nil {
|
if xmuxClient != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user