1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-02 23:47:07 -05:00

Remove unnecessary dns server from default dispatcher

This commit is contained in:
v2ray 2016-05-22 19:32:13 +02:00
parent 1b71c7d68d
commit 8b88f63280

View File

@ -2,7 +2,6 @@ package impl
import ( import (
"github.com/v2ray/v2ray-core/app" "github.com/v2ray/v2ray-core/app"
"github.com/v2ray/v2ray-core/app/dns"
"github.com/v2ray/v2ray-core/app/proxyman" "github.com/v2ray/v2ray-core/app/proxyman"
"github.com/v2ray/v2ray-core/app/router" "github.com/v2ray/v2ray-core/app/router"
"github.com/v2ray/v2ray-core/common/log" "github.com/v2ray/v2ray-core/common/log"
@ -14,7 +13,6 @@ import (
type DefaultDispatcher struct { type DefaultDispatcher struct {
ohm proxyman.OutboundHandlerManager ohm proxyman.OutboundHandlerManager
router router.Router router router.Router
dns dns.Server
} }
func NewDefaultDispatcher(space app.Space) *DefaultDispatcher { func NewDefaultDispatcher(space app.Space) *DefaultDispatcher {
@ -33,12 +31,6 @@ func (this *DefaultDispatcher) Initialize(space app.Space) error {
} }
this.ohm = space.GetApp(proxyman.APP_ID_OUTBOUND_MANAGER).(proxyman.OutboundHandlerManager) this.ohm = space.GetApp(proxyman.APP_ID_OUTBOUND_MANAGER).(proxyman.OutboundHandlerManager)
if !space.HasApp(dns.APP_ID) {
log.Error("DefaultDispatcher: DNS is not found in the space.")
return app.ErrorMissingApplication
}
this.dns = space.GetApp(dns.APP_ID).(dns.Server)
if space.HasApp(router.APP_ID) { if space.HasApp(router.APP_ID) {
this.router = space.GetApp(router.APP_ID).(router.Router) this.router = space.GetApp(router.APP_ID).(router.Router)
} }