better function name in SentPacketHandler

This commit is contained in:
Marten Seemann
2016-05-24 15:39:48 +07:00
parent 9539169fa4
commit 931687e9a4
5 changed files with 8 additions and 8 deletions

View File

@@ -18,7 +18,7 @@ type SentPacketHandler interface {
BytesInFlight() protocol.ByteCount
GetLargestObserved() protocol.PacketNumber
AllowsSending() bool
CongestionAllowsSending() bool
TimeToFirstRTO() time.Duration
}

View File

@@ -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()
}

View File

@@ -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() {