mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-12-13 05:14:17 +04:00
Refactor WrapLink logic (#5288)
https://github.com/XTLS/Xray-core/pull/5133 https://github.com/XTLS/Xray-core/pull/5286
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/xtls/xray-core/app/dispatcher"
|
||||
"github.com/xtls/xray-core/common"
|
||||
"github.com/xtls/xray-core/common/buf"
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
@@ -64,7 +63,9 @@ func (s *Server) DispatchLink(ctx context.Context, dest net.Destination, link *t
|
||||
if dest.Address != muxCoolAddress {
|
||||
return s.dispatcher.DispatchLink(ctx, dest, link)
|
||||
}
|
||||
link = s.dispatcher.(*dispatcher.DefaultDispatcher).WrapLink(ctx, link)
|
||||
if d, ok := s.dispatcher.(routing.WrapLinkDispatcher); ok {
|
||||
link = d.WrapLink(ctx, link)
|
||||
}
|
||||
worker, err := NewServerWorker(ctx, s.dispatcher, link)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user