XHTTP client: Fix a race condition and a data race (#6665)

https://github.com/XTLS/Xray-core/pull/6665#issuecomment-5429028477

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
This commit is contained in:
ivolfram
2026-08-26 19:19:41 +00:00
committed by GitHub
co-authored by 风扇滑翔翼
parent f124daf5a3
commit 77f98eba09
2 changed files with 8 additions and 6 deletions
+2 -1
View File
@@ -595,11 +595,12 @@ func (w uploadWriter) Write(b []byte) (int, error) {
var writed int
for _, buff := range buffer.MultiBuffer {
n := int(buff.Len())
err := w.WriteMultiBuffer(buf.MultiBuffer{buff})
if err != nil {
return writed, err
}
writed += int(buff.Len())
writed += n
}
return writed, nil
}