mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
always allocate buffer in Write
This commit is contained in:
parent
51ddc00c70
commit
23b768576e
@ -60,6 +60,10 @@ func (w *BufferedWriter) Write(b []byte) (int, error) {
|
|||||||
return w.legacyWriter.Write(b)
|
return w.legacyWriter.Write(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if w.buffer == nil {
|
||||||
|
w.buffer = New()
|
||||||
|
}
|
||||||
|
|
||||||
totalBytes := 0
|
totalBytes := 0
|
||||||
for len(b) > 0 {
|
for len(b) > 0 {
|
||||||
nBytes, err := w.buffer.Write(b)
|
nBytes, err := w.buffer.Write(b)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user