1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-26 12:07:47 -05:00

apply dispatcher interface

This commit is contained in:
Shelikhoo 2021-12-11 22:56:26 +00:00 committed by Xiaokang Wang (Shelikhoo)
parent ff704d15a7
commit bf8a0b7290
2 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ type ClassicNameServer struct {
ips map[string]record
requests map[uint16]dnsRequest
pub *pubsub.Service
udpServer *udp.Dispatcher
udpServer udp.DispatcherI
cleanup *task.Periodic
reqID uint32
}

View File

@ -32,7 +32,7 @@ type Dispatcher struct {
callback ResponseCallback
}
func NewSplitDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) *Dispatcher {
func NewSplitDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) DispatcherI {
return &Dispatcher{
conns: make(map[net.Destination]*connEntry),
dispatcher: dispatcher,
@ -133,7 +133,7 @@ func DialDispatcher(ctx context.Context, dispatcher routing.Dispatcher) (net.Pac
}
d := NewSplitDispatcher(dispatcher, c.callback)
c.dispatcher = d
c.dispatcher = d.(*Dispatcher)
return c, nil
}