mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-08 14:13:22 +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:
@@ -350,8 +350,11 @@ func (c *udpConn) ReadMultiBuffer() (buf.MultiBuffer, error) {
|
||||
return nil, io.EOF
|
||||
}
|
||||
|
||||
b := buf.NewWithSize(int32(len(q.p)))
|
||||
b.Write(q.p)
|
||||
b := buf.New()
|
||||
if _, err := b.Write(q.p); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
b.UDP = q.dest
|
||||
|
||||
return buf.MultiBuffer{b}, nil
|
||||
|
||||
Reference in New Issue
Block a user