diff --git a/protocol/server_parameters.go b/protocol/server_parameters.go index e95c16eab..de12c5de1 100644 --- a/protocol/server_parameters.go +++ b/protocol/server_parameters.go @@ -40,8 +40,8 @@ const MaxStreamsPerConnection uint32 = 100 // TODO: set a reasonable value here const MaxIdleConnectionStateLifetime = 60 * time.Second -// WindowUpdateNumRepitions is the number of times the same WindowUpdate frame will be sent to the client -const WindowUpdateNumRepitions uint8 = 2 +// WindowUpdateNumRepetitions is the number of times the same WindowUpdate frame will be sent to the client +const WindowUpdateNumRepetitions uint8 = 2 // MaxSessionUnprocessedPackets is the max number of packets stored in each session that are not yet processed. const MaxSessionUnprocessedPackets = 128 diff --git a/session_test.go b/session_test.go index c86b783e9..35ec39173 100644 --- a/session_test.go +++ b/session_test.go @@ -392,20 +392,20 @@ var _ = Describe("Session", func() { Expect(conn.written[0]).To(ContainSubstring(string([]byte{0x04, 0x05, 0, 0, 0}))) }) - It("repeats a WindowUpdate frame in WindowUpdateNumRepitions packets", func() { + It("repeats a WindowUpdate frame in WindowUpdateNumRepetitions packets", func() { _, err := session.OpenStream(5) Expect(err).ToNot(HaveOccurred()) err = session.updateReceiveFlowControlWindow(5, 0xDECAFBAD) Expect(err).ToNot(HaveOccurred()) - for i := uint8(0); i < protocol.WindowUpdateNumRepitions; i++ { + for i := uint8(0); i < protocol.WindowUpdateNumRepetitions; i++ { err = session.sendPacket() Expect(err).NotTo(HaveOccurred()) Expect(conn.written[i]).To(ContainSubstring(string([]byte{0x04, 0x05, 0, 0, 0}))) } - Expect(conn.written).To(HaveLen(int(protocol.WindowUpdateNumRepitions))) + Expect(conn.written).To(HaveLen(int(protocol.WindowUpdateNumRepetitions))) err = session.sendPacket() Expect(err).NotTo(HaveOccurred()) - Expect(conn.written).To(HaveLen(int(protocol.WindowUpdateNumRepitions))) // no packet was sent + Expect(conn.written).To(HaveLen(int(protocol.WindowUpdateNumRepetitions))) // no packet was sent }) It("sends public reset", func() { diff --git a/window_update_manager.go b/window_update_manager.go index 74ed779b6..70e3bde3b 100644 --- a/window_update_manager.go +++ b/window_update_manager.go @@ -50,7 +50,7 @@ func (m *windowUpdateManager) GetWindowUpdateFrames() []*frames.WindowUpdateFram var wuf []*frames.WindowUpdateFrame for key, value := range m.streamOffsets { - if value.Counter >= protocol.WindowUpdateNumRepitions { + if value.Counter >= protocol.WindowUpdateNumRepetitions { continue } diff --git a/window_update_manager_test.go b/window_update_manager_test.go index 5a2b805bf..0e6607b28 100644 --- a/window_update_manager_test.go +++ b/window_update_manager_test.go @@ -65,8 +65,8 @@ var _ = Describe("WindowUpdateManager", func() { Expect(wum.streamOffsets[9].Counter).To(Equal(uint8(1))) }) - It("only sends out a window update frame WindowUpdateNumRepitions times", func() { - for i := uint8(0); i < protocol.WindowUpdateNumRepitions; i++ { + It("only sends out a window update frame WindowUpdateNumRepetitions times", func() { + for i := uint8(0); i < protocol.WindowUpdateNumRepetitions; i++ { frames := wum.GetWindowUpdateFrames() Expect(frames).To(HaveLen(2)) }