forked from quic-go/quic-go
better function name in SentPacketHandler
This commit is contained in:
@@ -18,7 +18,7 @@ type SentPacketHandler interface {
|
||||
BytesInFlight() protocol.ByteCount
|
||||
GetLargestObserved() protocol.PacketNumber
|
||||
|
||||
AllowsSending() bool
|
||||
CongestionAllowsSending() bool
|
||||
|
||||
TimeToFirstRTO() time.Duration
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ func (h *sentPacketHandler) GetLargestObserved() protocol.PacketNumber {
|
||||
return h.LargestObserved
|
||||
}
|
||||
|
||||
func (h *sentPacketHandler) AllowsSending() bool {
|
||||
func (h *sentPacketHandler) CongestionAllowsSending() bool {
|
||||
return h.BytesInFlight() <= h.congestion.GetCongestionWindow()
|
||||
}
|
||||
|
||||
|
||||
@@ -589,10 +589,10 @@ var _ = Describe("SentPacketHandler", func() {
|
||||
})
|
||||
|
||||
It("allows or denies sending", func() {
|
||||
Expect(handler.AllowsSending()).To(BeTrue())
|
||||
Expect(handler.CongestionAllowsSending()).To(BeTrue())
|
||||
err := handler.SentPacket(&Packet{PacketNumber: 1, Frames: []frames.Frame{}, Length: protocol.DefaultTCPMSS + 1})
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(handler.AllowsSending()).To(BeFalse())
|
||||
Expect(handler.CongestionAllowsSending()).To(BeFalse())
|
||||
})
|
||||
|
||||
It("should call OnRetransmissionTimeout", func() {
|
||||
|
||||
Reference in New Issue
Block a user