mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
apply dispatcher interface
This commit is contained in:
parent
ff704d15a7
commit
bf8a0b7290
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user