forked from quic-go/quic-go
append to a byte slice instead of a bytes.Buffer when serializing frames
This commit is contained in:
@@ -33,11 +33,11 @@ func parseMaxStreamDataFrame(r *bytes.Reader, _ protocol.VersionNumber) (*MaxStr
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (f *MaxStreamDataFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error {
|
||||
b.WriteByte(0x11)
|
||||
quicvarint.Write(b, uint64(f.StreamID))
|
||||
quicvarint.Write(b, uint64(f.MaximumStreamData))
|
||||
return nil
|
||||
func (f *MaxStreamDataFrame) Write(b []byte, version protocol.VersionNumber) ([]byte, error) {
|
||||
b = append(b, 0x11)
|
||||
b = quicvarint.Append(b, uint64(f.StreamID))
|
||||
b = quicvarint.Append(b, uint64(f.MaximumStreamData))
|
||||
return b, nil
|
||||
}
|
||||
|
||||
// Length of a written frame
|
||||
|
||||
Reference in New Issue
Block a user