send WindowUpdate frames

fixes #19
This commit is contained in:
Marten Seemann
2016-05-15 16:46:34 +07:00
parent 540941117e
commit a3ff4dd891
6 changed files with 115 additions and 27 deletions

View File

@@ -342,6 +342,17 @@ var _ = Describe("Session", func() {
Expect(conn.written[0]).To(ContainSubstring(string("foobar")))
})
It("sends a WindowUpdate frame", func() {
_, err := session.NewStream(5)
Expect(err).ToNot(HaveOccurred())
err = session.UpdateReceiveFlowControlWindow(5, 0xDECAFBAD)
Expect(err).ToNot(HaveOccurred())
err = session.sendPacket()
Expect(err).NotTo(HaveOccurred())
Expect(conn.written).To(HaveLen(1))
Expect(conn.written[0]).To(ContainSubstring(string([]byte{0x04, 0x05, 0, 0, 0})))
})
It("sends public reset", func() {
err := session.sendPublicReset(1)
Expect(err).NotTo(HaveOccurred())