forked from quic-go/quic-go
wire: use constants for frame types (#3739)
This commit is contained in:
@@ -17,9 +17,9 @@ type MaxStreamsFrame struct {
|
||||
func parseMaxStreamsFrame(r *bytes.Reader, typ uint64, _ protocol.VersionNumber) (*MaxStreamsFrame, error) {
|
||||
f := &MaxStreamsFrame{}
|
||||
switch typ {
|
||||
case 0x12:
|
||||
case bidiMaxStreamsFrameType:
|
||||
f.Type = protocol.StreamTypeBidi
|
||||
case 0x13:
|
||||
case uniMaxStreamsFrameType:
|
||||
f.Type = protocol.StreamTypeUni
|
||||
}
|
||||
streamID, err := quicvarint.Read(r)
|
||||
@@ -36,9 +36,9 @@ func parseMaxStreamsFrame(r *bytes.Reader, typ uint64, _ protocol.VersionNumber)
|
||||
func (f *MaxStreamsFrame) Append(b []byte, _ protocol.VersionNumber) ([]byte, error) {
|
||||
switch f.Type {
|
||||
case protocol.StreamTypeBidi:
|
||||
b = append(b, 0x12)
|
||||
b = append(b, bidiMaxStreamsFrameType)
|
||||
case protocol.StreamTypeUni:
|
||||
b = append(b, 0x13)
|
||||
b = append(b, uniMaxStreamsFrameType)
|
||||
}
|
||||
b = quicvarint.Append(b, uint64(f.MaxStreamNum))
|
||||
return b, nil
|
||||
|
||||
Reference in New Issue
Block a user