mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-10 06:08:41 +00:00
Glue mux meta with data in one frame for Datagram
This commit is contained in:
parent
e4a5344189
commit
c29af68a2f
2 changed files with 5 additions and 3 deletions
|
@ -78,10 +78,10 @@ func writeMetaWithFrame(writer buf.Writer, meta FrameMetadata, data buf.MultiBuf
|
|||
if _, err := serial.WriteUint16(frame, uint16(data.Len())); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mb2 := make(buf.MultiBuffer, 0, len(data)+1)
|
||||
mb2 = append(mb2, frame)
|
||||
mb2 = append(mb2, data...)
|
||||
mb2 = buf.Compact(mb2)
|
||||
return writer.WriteMultiBuffer(mb2)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue