diff --git a/app/dispatcher/default.go b/app/dispatcher/default.go index fead3c644..5a55c1b2f 100644 --- a/app/dispatcher/default.go +++ b/app/dispatcher/default.go @@ -15,7 +15,6 @@ import ( "v2ray.com/core/common/net" "v2ray.com/core/common/protocol" "v2ray.com/core/common/session" - "v2ray.com/core/common/vio" "v2ray.com/core/features/outbound" "v2ray.com/core/features/policy" "v2ray.com/core/features/routing" @@ -151,7 +150,7 @@ func (d *DefaultDispatcher) getLink(ctx context.Context) (*transport.Link, *tran if p.Stats.UserUplink { name := "user>>>" + user.Email + ">>>traffic>>>uplink" if c, _ := stats.GetOrRegisterCounter(d.stats, name); c != nil { - inboundLink.Writer = &vio.SizeStatWriter{ + inboundLink.Writer = &SizeStatWriter{ Counter: c, Writer: inboundLink.Writer, } @@ -160,7 +159,7 @@ func (d *DefaultDispatcher) getLink(ctx context.Context) (*transport.Link, *tran if p.Stats.UserDownlink { name := "user>>>" + user.Email + ">>>traffic>>>downlink" if c, _ := stats.GetOrRegisterCounter(d.stats, name); c != nil { - outboundLink.Writer = &vio.SizeStatWriter{ + outboundLink.Writer = &SizeStatWriter{ Counter: c, Writer: outboundLink.Writer, } diff --git a/common/vio/stats.go b/app/dispatcher/stats.go similarity index 96% rename from common/vio/stats.go rename to app/dispatcher/stats.go index 4b6c81415..c0758233c 100644 --- a/common/vio/stats.go +++ b/app/dispatcher/stats.go @@ -1,4 +1,4 @@ -package vio +package dispatcher import ( "v2ray.com/core/common" diff --git a/common/vio/stats_test.go b/app/dispatcher/stats_test.go similarity index 92% rename from common/vio/stats_test.go rename to app/dispatcher/stats_test.go index cab2bca01..5a42faa3f 100644 --- a/common/vio/stats_test.go +++ b/app/dispatcher/stats_test.go @@ -1,11 +1,11 @@ -package vio_test +package dispatcher_test import ( "testing" + . "v2ray.com/core/app/dispatcher" "v2ray.com/core/common" "v2ray.com/core/common/buf" - . "v2ray.com/core/common/vio" ) type TestCounter int64