Merge pull request #2841 from lucas-clemente/pad-server-initials

pad datagrams containing ack-eliciting Initial packets sent by the server
This commit is contained in:
Marten Seemann
2020-10-30 15:12:03 +07:00
committed by GitHub
4 changed files with 124 additions and 108 deletions

View File

@@ -4,8 +4,9 @@ import "github.com/lucas-clemente/quic-go/internal/wire"
// IsFrameAckEliciting returns true if the frame is ack-eliciting.
func IsFrameAckEliciting(f wire.Frame) bool {
_, ok := f.(*wire.AckFrame)
return !ok
_, isAck := f.(*wire.AckFrame)
_, isConnectionClose := f.(*wire.ConnectionCloseFrame)
return !isAck && !isConnectionClose
}
// HasAckElicitingFrames returns true if at least one frame is ack-eliciting.

View File

@@ -11,8 +11,8 @@ import (
var _ = Describe("ack-eliciting frames", func() {
for fl, el := range map[wire.Frame]bool{
&wire.AckFrame{}: false,
&wire.ConnectionCloseFrame{}: false,
&wire.DataBlockedFrame{}: true,
&wire.ConnectionCloseFrame{}: true,
&wire.PingFrame{}: true,
&wire.ResetStreamFrame{}: true,
&wire.StreamFrame{}: true,