1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-16 01:17:30 -05:00

minor fix

This commit is contained in:
Darien Raymond 2016-01-21 16:29:18 +00:00
parent d8c6102638
commit d623b1809d
2 changed files with 3 additions and 2 deletions

View File

@ -31,6 +31,8 @@ func TestSwitchAccount(t *testing.T) {
cmd.Unmarshal(buffer.Bytes())
sa2, ok := cmd.(*SwitchAccount)
assert.Bool(ok).IsTrue()
assert.Pointer(sa.Host).IsNil()
assert.Pointer(sa2.Host).IsNil()
netassert.Port(sa.Port).Equals(sa2.Port)
assert.String(sa.ID).Equals(sa2.ID.String())
assert.Uint16(sa.AlterIds.Value()).Equals(sa2.AlterIds.Value())

View File

@ -16,11 +16,10 @@ func (this *VMessInboundHandler) generateCommand(buffer *alloc.Buffer) {
tag := this.features.Detour.ToTag
if this.space.HasInboundHandlerManager() {
handlerManager := this.space.InboundHandlerManager()
handler, availableSec := handlerManager.GetHandler(tag)
handler, availableMin := handlerManager.GetHandler(tag)
inboundHandler, ok := handler.(*VMessInboundHandler)
if ok {
user := inboundHandler.GetUser()
availableMin := availableSec / 60
if availableMin > 255 {
availableMin = 255
}