rename MaxDataFrame.ByteOffset to MaximumData

This commit is contained in:
Marten Seemann 2020-07-02 16:23:25 +07:00
parent 00f8028e52
commit f4519cfd32
16 changed files with 32 additions and 32 deletions

View file

@ -9,7 +9,7 @@ import (
// A MaxDataFrame carries flow control information for the connection
type MaxDataFrame struct {
ByteOffset protocol.ByteCount
MaximumData protocol.ByteCount
}
// parseMaxDataFrame parses a MAX_DATA frame
@ -23,18 +23,18 @@ func parseMaxDataFrame(r *bytes.Reader, _ protocol.VersionNumber) (*MaxDataFrame
if err != nil {
return nil, err
}
frame.ByteOffset = protocol.ByteCount(byteOffset)
frame.MaximumData = protocol.ByteCount(byteOffset)
return frame, nil
}
//Write writes a MAX_STREAM_DATA frame
func (f *MaxDataFrame) Write(b *bytes.Buffer, version protocol.VersionNumber) error {
b.WriteByte(0x10)
utils.WriteVarInt(b, uint64(f.ByteOffset))
utils.WriteVarInt(b, uint64(f.MaximumData))
return nil
}
// Length of a written frame
func (f *MaxDataFrame) Length(version protocol.VersionNumber) protocol.ByteCount {
return 1 + utils.VarIntLen(uint64(f.ByteOffset))
return 1 + utils.VarIntLen(uint64(f.MaximumData))
}