1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-26 14:09:06 -04:00

refine dispatcher

This commit is contained in:
Darien Raymond
2016-11-13 14:33:00 +01:00
parent 5dc05d6352
commit 9471b5b066
13 changed files with 31 additions and 27 deletions

View File

@@ -43,7 +43,7 @@ func (this *DefaultDispatcher) Release() {
}
func (this *DefaultDispatcher) DispatchToOutbound(meta *proxy.InboundHandlerMeta, session *proxy.SessionInfo) ray.InboundRay {
func (this *DefaultDispatcher) DispatchToOutbound(session *proxy.SessionInfo) ray.InboundRay {
direct := ray.NewRay()
dispatcher := this.ohm.GetDefaultHandler()
destination := session.Destination
@@ -61,7 +61,7 @@ func (this *DefaultDispatcher) DispatchToOutbound(meta *proxy.InboundHandlerMeta
}
}
if meta.AllowPassiveConnection {
if session.Inbound != nil && session.Inbound.AllowPassiveConnection {
go dispatcher.Dispatch(destination, alloc.NewLocalBuffer(32).Clear(), direct)
} else {
go this.FilterPacketAndDispatch(destination, direct, dispatcher)