mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-14 10:00:34 +00:00
Chore: Use buf.New() instead of buf.NewWithSize() (#5946)
https://github.com/XTLS/Xray-core/pull/5941#issuecomment-4252905907 https://github.com/XTLS/Xray-core/pull/5946#issuecomment-4253919073
This commit is contained in:
@@ -103,8 +103,10 @@ func (c *udpConn) ReadMultiBuffer() (buf.MultiBuffer, error) {
|
||||
return nil, io.EOF
|
||||
}
|
||||
|
||||
b := buf.NewWithSize(int32(len(e.data)))
|
||||
b.Write(e.data)
|
||||
b := buf.New()
|
||||
if _, err := b.Write(e.data); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b.UDP = e.dest
|
||||
|
||||
return buf.MultiBuffer{b}, nil
|
||||
|
||||
Reference in New Issue
Block a user