MCPcopy Index your code
hub / github.com/XTLS/REALITY / Read

Method Read

tls.go:110–120  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

108}
109
110func (c *RatelimitedConn) Read(b []byte) (int, error) {
111 n, err := c.Conn.Read(b)
112 if n != 0 {
113 if c.After > 0 {
114 c.After -= int64(n)
115 } else {
116 c.Bucket.Wait(int64(n))
117 }
118 }
119 return n, err
120}
121
122func NewRatelimitedConn(conn net.Conn, limit *LimitFallback) net.Conn {
123 if limit.BytesPerSec == 0 {

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected