From 9f6822411b192c577d0453f11b390d61c314b9d5 Mon Sep 17 00:00:00 2001 From: v2ray Date: Mon, 25 Jan 2016 00:43:55 +0100 Subject: [PATCH] late set of cmd id --- proxy/vmess/inbound/command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/vmess/inbound/command.go b/proxy/vmess/inbound/command.go index bc2aa38b0..401440650 100644 --- a/proxy/vmess/inbound/command.go +++ b/proxy/vmess/inbound/command.go @@ -15,17 +15,17 @@ func (this *VMessInboundHandler) generateCommand(buffer *alloc.Buffer) { defer commandBytes.Release() if this.features != nil && this.features.Detour != nil { - cmd = byte(1) + tag := this.features.Detour.ToTag if this.space.HasInboundHandlerManager() { handlerManager := this.space.InboundHandlerManager() handler, availableMin := handlerManager.GetHandler(tag) - inboundHandler, ok := handler.(*VMessInboundHandler) if ok { if availableMin > 255 { availableMin = 255 } + cmd = byte(1) log.Info("VMessIn: Pick detour handler for port ", inboundHandler.Port(), " for ", availableMin, " minutes.") user := inboundHandler.GetUser() saCmd := &command.SwitchAccount{