mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-27 05:27:00 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user