dice.Roll()

This commit is contained in:
v2ray
2016-01-21 22:45:44 +01:00
parent d623b1809d
commit 37a9d8ef50
6 changed files with 23 additions and 36 deletions
+2 -4
View File
@@ -1,9 +1,8 @@
package point
import (
"math/rand"
"github.com/v2ray/v2ray-core/app"
"github.com/v2ray/v2ray-core/common/dice"
"github.com/v2ray/v2ray-core/common/log"
v2net "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/common/retry"
@@ -46,8 +45,7 @@ func NewInboundDetourHandlerAlways(space app.Space, config *InboundDetourConfig)
}
func (this *InboundDetourHandlerAlways) GetConnectionHandler() (proxy.InboundConnectionHandler, int) {
idx := rand.Intn(len(this.ich))
ich := this.ich[idx]
ich := this.ich[dice.Roll(len(this.ich))]
return ich.handler, this.config.Allocation.Refresh
}