github.com/tumi8/quic-go@v0.37.4-tum/noninternal/ackhandler/ack_eliciting.go (about)

     1  package ackhandler
     2  
     3  import "github.com/tumi8/quic-go/noninternal/wire"
     4  
     5  // IsFrameAckEliciting returns true if the frame is ack-eliciting.
     6  func IsFrameAckEliciting(f wire.Frame) bool {
     7  	_, isAck := f.(*wire.AckFrame)
     8  	_, isConnectionClose := f.(*wire.ConnectionCloseFrame)
     9  	return !isAck && !isConnectionClose
    10  }
    11  
    12  // HasAckElicitingFrames returns true if at least one frame is ack-eliciting.
    13  func HasAckElicitingFrames(fs []Frame) bool {
    14  	for _, f := range fs {
    15  		if IsFrameAckEliciting(f.Frame) {
    16  			return true
    17  		}
    18  	}
    19  	return false
    20  }