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

late set of cmd id

This commit is contained in:
v2ray 2016-01-25 00:43:55 +01:00
parent b6e23de0d3
commit 9f6822411b

View File

@ -15,17 +15,17 @@ func (this *VMessInboundHandler) generateCommand(buffer *alloc.Buffer) {
defer commandBytes.Release() defer commandBytes.Release()
if this.features != nil && this.features.Detour != nil { if this.features != nil && this.features.Detour != nil {
cmd = byte(1)
tag := this.features.Detour.ToTag tag := this.features.Detour.ToTag
if this.space.HasInboundHandlerManager() { if this.space.HasInboundHandlerManager() {
handlerManager := this.space.InboundHandlerManager() handlerManager := this.space.InboundHandlerManager()
handler, availableMin := handlerManager.GetHandler(tag) handler, availableMin := handlerManager.GetHandler(tag)
inboundHandler, ok := handler.(*VMessInboundHandler) inboundHandler, ok := handler.(*VMessInboundHandler)
if ok { if ok {
if availableMin > 255 { if availableMin > 255 {
availableMin = 255 availableMin = 255
} }
cmd = byte(1)
log.Info("VMessIn: Pick detour handler for port ", inboundHandler.Port(), " for ", availableMin, " minutes.") log.Info("VMessIn: Pick detour handler for port ", inboundHandler.Port(), " for ", availableMin, " minutes.")
user := inboundHandler.GetUser() user := inboundHandler.GetUser()
saCmd := &command.SwitchAccount{ saCmd := &command.SwitchAccount{