Skip to content

Commit

Permalink
XHTTP XMUX: Fix OpenUsage never gets reduced
Browse files Browse the repository at this point in the history
Introduced in #4163
  • Loading branch information
RPRX authored Dec 20, 2024
1 parent cab2fde commit 1410b63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions transport/internet/splithttp/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,15 @@ 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,
reader: reader,
remoteAddr: remoteAddr,
localAddr: localAddr,
onClose: func() {
if once.Add(-1) < 0 {
if closed.Add(1) > 1 {
return
}
if xmuxClient != nil {
Expand Down

0 comments on commit 1410b63

Please sign in to comment.