Merge branch 'dev_new' of github.com:wyx2685/V2bX into dev_new

This commit is contained in:
wyx2685
2025-12-03 05:24:57 +09:00
3 changed files with 30 additions and 13 deletions

View File

@@ -19,11 +19,17 @@ type Conn struct {
}
func (c *Conn) Read(b []byte) (n int, err error) {
c.limiter.Wait(int64(len(b)))
return c.Conn.Read(b)
n, err = c.Conn.Read(b)
if n > 0 {
c.limiter.Wait(int64(n))
}
return n, err
}
func (c *Conn) Write(b []byte) (n int, err error) {
c.limiter.Wait(int64(len(b)))
return c.Conn.Write(b)
}
n, err = c.Conn.Write(b)
if n > 0 {
c.limiter.Wait(int64(n))
}
return n, err
}