Skip to content

Commit 50d8178

Browse files
committed
Remove redundant stats in mux and bridge dispatcher
Since mux will add traffic stats in sub connection's dispatch function Adding additional stats result to double counting
1 parent b0d3181 commit 50d8178

File tree

2 files changed

+0
-5
lines changed

2 files changed

+0
-5
lines changed

app/reverse/bridge.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"time"
66

7-
"github.com/xtls/xray-core/app/dispatcher"
87
"github.com/xtls/xray-core/common/errors"
98
"github.com/xtls/xray-core/common/mux"
109
"github.com/xtls/xray-core/common/net"
@@ -230,8 +229,6 @@ func (w *BridgeWorker) DispatchLink(ctx context.Context, dest net.Destination, l
230229
}
231230
return w.Dispatcher.DispatchLink(ctx, dest, link)
232231
}
233-
234-
link = w.Dispatcher.(*dispatcher.DefaultDispatcher).WrapLink(ctx, link)
235232
w.handleInternalConn(link)
236233

237234
return nil

common/mux/server.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"io"
66
"time"
77

8-
"github.com/xtls/xray-core/app/dispatcher"
98
"github.com/xtls/xray-core/common"
109
"github.com/xtls/xray-core/common/buf"
1110
"github.com/xtls/xray-core/common/errors"
@@ -64,7 +63,6 @@ func (s *Server) DispatchLink(ctx context.Context, dest net.Destination, link *t
6463
if dest.Address != muxCoolAddress {
6564
return s.dispatcher.DispatchLink(ctx, dest, link)
6665
}
67-
link = s.dispatcher.(*dispatcher.DefaultDispatcher).WrapLink(ctx, link)
6866
worker, err := NewServerWorker(ctx, s.dispatcher, link)
6967
if err != nil {
7068
return err

0 commit comments

Comments
 (0)