1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-05 16:55:27 -05:00

context'ize apps

This commit is contained in:
Darien Raymond
2017-01-13 13:41:40 +01:00
parent 148e4832eb
commit 17504d2aac
15 changed files with 171 additions and 152 deletions

View File

@@ -2,7 +2,6 @@ package dispatcher
import (
"v2ray.com/core/app"
"v2ray.com/core/common/serial"
"v2ray.com/core/proxy"
"v2ray.com/core/transport/ray"
)
@@ -13,7 +12,7 @@ type PacketDispatcher interface {
}
func FromSpace(space app.Space) PacketDispatcher {
if app := space.(app.AppGetter).GetApp(serial.GetMessageType((*Config)(nil))); app != nil {
if app := space.GetApplication((*PacketDispatcher)(nil)); app != nil {
return app.(PacketDispatcher)
}
return nil