Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename retransmittable to ack-eliciting
- Loading branch information
1 parent
9ad6a7b
commit b5336be
Showing
14 changed files
with
178 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package ackhandler | ||
|
||
import "github.com/lucas-clemente/quic-go/internal/wire" | ||
|
||
// Returns a new slice with all non-ack-eliciting frames deleted. | ||
func stripNonAckElicitingFrames(fs []wire.Frame) []wire.Frame { | ||
res := make([]wire.Frame, 0, len(fs)) | ||
for _, f := range fs { | ||
if IsFrameAckEliciting(f) { | ||
res = append(res, f) | ||
} | ||
} | ||
return res | ||
} | ||
|
||
// IsFrameAckEliciting returns true if the frame is ack-eliciting. | ||
func IsFrameAckEliciting(f wire.Frame) bool { | ||
switch f.(type) { | ||
case *wire.AckFrame: | ||
return false | ||
default: | ||
return true | ||
} | ||
} | ||
|
||
// HasAckElicitingFrames returns true if at least one frame is ack-eliciting. | ||
func HasAckElicitingFrames(fs []wire.Frame) bool { | ||
for _, f := range fs { | ||
if IsFrameAckEliciting(f) { | ||
return true | ||
} | ||
} | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.