mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 17:46:58 -05:00
Fix when rolled number is zero
This commit is contained in:
parent
13cef19430
commit
5e59534333
@ -38,6 +38,8 @@ const (
|
|||||||
RequestOptionChunkMasking bitmask.Byte = 0x04
|
RequestOptionChunkMasking bitmask.Byte = 0x04
|
||||||
|
|
||||||
RequestOptionGlobalPadding bitmask.Byte = 0x08
|
RequestOptionGlobalPadding bitmask.Byte = 0x08
|
||||||
|
|
||||||
|
RequestOptionEarlyChecksum bitmask.Byte = 0x16
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestHeader struct {
|
type RequestHeader struct {
|
||||||
|
@ -126,7 +126,7 @@ func parseSecurityType(b byte) protocol.SecurityType {
|
|||||||
func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error) {
|
func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error) {
|
||||||
buffer := buf.New()
|
buffer := buf.New()
|
||||||
behaviorRand := dice.NewDeterministicDice(int64(s.userValidator.GetBehaviorSeed()))
|
behaviorRand := dice.NewDeterministicDice(int64(s.userValidator.GetBehaviorSeed()))
|
||||||
DrainSize := behaviorRand.Roll(3266) + 16 + 38 + dice.Roll(behaviorRand.Roll(64))
|
DrainSize := behaviorRand.Roll(3266) + 16 + 38 + dice.Roll(behaviorRand.Roll(64)+1)
|
||||||
readSizeRemain := DrainSize
|
readSizeRemain := DrainSize
|
||||||
|
|
||||||
drainConnection := func(e error) error {
|
drainConnection := func(e error) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user