protocol: add string representation for ECN values (#4008)

This commit is contained in:
Marten Seemann
2023-08-19 07:17:37 +07:00
committed by GitHub
parent 5c5db8cc59
commit 443c6148b6
2 changed files with 23 additions and 0 deletions

View File

@@ -43,6 +43,21 @@ const (
ECNCE // 11
)
func (e ECN) String() string {
switch e {
case ECNNon:
return "Not-ECT"
case ECT1:
return "ECT(1)"
case ECT0:
return "ECT(0)"
case ECNCE:
return "CE"
default:
return fmt.Sprintf("invalid ECN value: %d", e)
}
}
// A ByteCount in QUIC
type ByteCount int64