mirror of
https://github.com/XTLS/REALITY.git
synced 2025-08-22 14:38:35 +00:00
conn
This commit is contained in:
parent
b1225047c7
commit
fad0d8da96
4
tls.go
4
tls.go
@ -119,7 +119,7 @@ func (c *RatelimitedConn) Read(b []byte) (int, error) {
|
|||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRatelimitedConn(con net.Conn, limit *LimitFallback) *RatelimitedConn {
|
func NewRatelimitedConn(conn net.Conn, limit *LimitFallback) net.Conn {
|
||||||
bytesPerSec := limit.BytesPerSec
|
bytesPerSec := limit.BytesPerSec
|
||||||
burstBytesPerSec := limit.BurstBytesPerSec
|
burstBytesPerSec := limit.BurstBytesPerSec
|
||||||
afterBytes := limit.AfterBytes
|
afterBytes := limit.AfterBytes
|
||||||
@ -129,7 +129,7 @@ func NewRatelimitedConn(con net.Conn, limit *LimitFallback) *RatelimitedConn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &RatelimitedConn{
|
return &RatelimitedConn{
|
||||||
Conn: con,
|
Conn: conn,
|
||||||
Bucket: ratelimit.NewBucketWithRate(float64(bytesPerSec), int64(burstBytesPerSec)),
|
Bucket: ratelimit.NewBucketWithRate(float64(bytesPerSec), int64(burstBytesPerSec)),
|
||||||
LimitAfter: int64(afterBytes),
|
LimitAfter: int64(afterBytes),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user