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

This commit is contained in:
wyx2685 committed 2025-12-03 05:24:57 +09:00
commit f32c672c4d
3 files changed
+30 -13

No files matched your search

+11 -5
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
}