fix(limiter/traffic): infinite Write loop on zero burst, missing httpLoader.Close, stale reload values, ignored WaitN error, silent UDP drops, SplitHostPort fallback

This commit is contained in:
ginuerzh
2026-05-24 20:20:01 +08:00
parent 9bbd7da526
commit e9372ea44a
4 changed files with 33 additions and 23 deletions
+5 -1
View File
@@ -69,7 +69,11 @@ func (p *readWriter) Write(b []byte) (n int, err error) {
nn := 0
for len(b) > 0 {
nn, err = p.ReadWriter.Write(b[:limiter.Wait(context.Background(), len(b))])
burst := limiter.Wait(context.Background(), len(b))
if burst == 0 {
return
}
nn, err = p.ReadWriter.Write(b[:burst])
n += nn
if err != nil {
return