mirror of
https://github.com/XTLS/REALITY.git
synced 2025-08-22 14:38:35 +00:00
int64
This commit is contained in:
parent
766b7c6936
commit
d7bec4a74f
@ -539,7 +539,7 @@ const (
|
||||
|
||||
type LimitFallback struct {
|
||||
AfterBytes int64
|
||||
BytesPerSec float64
|
||||
BytesPerSec int64
|
||||
BurstBytesPerSec int64
|
||||
}
|
||||
|
||||
|
9
tls.go
9
tls.go
@ -43,7 +43,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net"
|
||||
"os"
|
||||
"runtime"
|
||||
@ -120,11 +119,11 @@ func (c *RatelimitedConn) Write(b []byte) (int, error) {
|
||||
return n, err
|
||||
}
|
||||
|
||||
func NewBucketWithRate(bytesPerSec float64, burstBytesPerSec int64) *ratelimit.Bucket {
|
||||
if burstBytesPerSec < int64(math.Ceil(bytesPerSec)) {
|
||||
burstBytesPerSec = int64(math.Ceil(bytesPerSec))
|
||||
func NewBucketWithRate(bytesPerSec int64, burstBytesPerSec int64) *ratelimit.Bucket {
|
||||
if burstBytesPerSec < bytesPerSec {
|
||||
burstBytesPerSec = bytesPerSec
|
||||
}
|
||||
return ratelimit.NewBucketWithRate(bytesPerSec, burstBytesPerSec)
|
||||
return ratelimit.NewBucketWithRate(float64(bytesPerSec), burstBytesPerSec)
|
||||
}
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user