implement BlockedFrame writing

This commit is contained in:
Marten Seemann
2016-05-03 14:04:01 +07:00
parent f240df6ea5
commit ce01b5ed30
2 changed files with 24 additions and 2 deletions

View File

@@ -14,12 +14,20 @@ type BlockedFrame struct {
//Write writes a RST_STREAM frame
func (f *BlockedFrame) Write(b *bytes.Buffer, packetNumber protocol.PacketNumber, packetNumberLen uint8) error {
panic("BlockedFrame: Write not yet implemented")
b.WriteByte(0x05)
if f.StreamID == 0 {
panic("Writing of connection level BlockedFrames not yet implemented.")
}
utils.WriteUint32(b, uint32(f.StreamID))
return nil
}
// MinLength of a written frame
func (f *BlockedFrame) MinLength() int {
panic("BlockedFrame: Write not yet implemented")
return 1 + 4
}
// ParseBlockedFrame parses a BLOCKED frame