wire: correctly parse multi-byte frame types (#3736)

This commit is contained in:
Marten Seemann
2023-04-19 14:42:23 +02:00
committed by GitHub
parent 3f06880917
commit da26f91905
42 changed files with 262 additions and 394 deletions

View File

@@ -1,21 +1,12 @@
package wire
import (
"bytes"
"github.com/quic-go/quic-go/internal/protocol"
)
// A PingFrame is a PING frame
type PingFrame struct{}
func parsePingFrame(r *bytes.Reader, _ protocol.VersionNumber) (*PingFrame, error) {
if _, err := r.ReadByte(); err != nil {
return nil, err
}
return &PingFrame{}, nil
}
func (f *PingFrame) Append(b []byte, _ protocol.VersionNumber) ([]byte, error) {
return append(b, 0x1), nil
}