mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-28 22:31:25 +03:00
Glue mux meta with data in one frame for Datagram
This commit is contained in:
parent
e4a5344189
commit
c29af68a2f
@ -90,7 +90,8 @@ func TestRegressionOutboundLeak(t *testing.T) {
|
||||
}
|
||||
|
||||
{
|
||||
b := buf.FromBytes([]byte("hello"))
|
||||
b := buf.New()
|
||||
b.Write([]byte("hello"))
|
||||
common.Must(muxClientDownlink.Writer.WriteMultiBuffer(buf.MultiBuffer{b}))
|
||||
}
|
||||
|
||||
@ -102,7 +103,8 @@ func TestRegressionOutboundLeak(t *testing.T) {
|
||||
}
|
||||
|
||||
{
|
||||
b := buf.FromBytes([]byte("world"))
|
||||
b := buf.New()
|
||||
b.Write([]byte("world"))
|
||||
common.Must(websiteUplink.Writer.WriteMultiBuffer(buf.MultiBuffer{b}))
|
||||
}
|
||||
|
||||
|
@ -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…
x
Reference in New Issue
Block a user