mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-09-28 14:56:33 -04:00
apply dispatcher interface
This commit is contained in:
parent
ff704d15a7
commit
bf8a0b7290
@ -33,7 +33,7 @@ type ClassicNameServer struct {
|
|||||||
ips map[string]record
|
ips map[string]record
|
||||||
requests map[uint16]dnsRequest
|
requests map[uint16]dnsRequest
|
||||||
pub *pubsub.Service
|
pub *pubsub.Service
|
||||||
udpServer *udp.Dispatcher
|
udpServer udp.DispatcherI
|
||||||
cleanup *task.Periodic
|
cleanup *task.Periodic
|
||||||
reqID uint32
|
reqID uint32
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ type Dispatcher struct {
|
|||||||
callback ResponseCallback
|
callback ResponseCallback
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSplitDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) *Dispatcher {
|
func NewSplitDispatcher(dispatcher routing.Dispatcher, callback ResponseCallback) DispatcherI {
|
||||||
return &Dispatcher{
|
return &Dispatcher{
|
||||||
conns: make(map[net.Destination]*connEntry),
|
conns: make(map[net.Destination]*connEntry),
|
||||||
dispatcher: dispatcher,
|
dispatcher: dispatcher,
|
||||||
@ -133,7 +133,7 @@ func DialDispatcher(ctx context.Context, dispatcher routing.Dispatcher) (net.Pac
|
|||||||
}
|
}
|
||||||
|
|
||||||
d := NewSplitDispatcher(dispatcher, c.callback)
|
d := NewSplitDispatcher(dispatcher, c.callback)
|
||||||
c.dispatcher = d
|
c.dispatcher = d.(*Dispatcher)
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user