forked from quic-go/quic-go
append to a byte slice instead of a bytes.Buffer when serializing frames
This commit is contained in:
@@ -26,10 +26,10 @@ func parsePathResponseFrame(r *bytes.Reader, _ protocol.VersionNumber) (*PathRes
|
||||
return frame, nil
|
||||
}
|
||||
|
||||
func (f *PathResponseFrame) Write(b *bytes.Buffer, _ protocol.VersionNumber) error {
|
||||
b.WriteByte(0x1b)
|
||||
b.Write(f.Data[:])
|
||||
return nil
|
||||
func (f *PathResponseFrame) Write(b []byte, _ protocol.VersionNumber) ([]byte, error) {
|
||||
b = append(b, 0x1b)
|
||||
b = append(b, f.Data[:]...)
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// Length of a written frame
|
||||
|
||||
Reference in New Issue
Block a user