Skip to content

Commit

Permalink
Fix test for 5.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
summerwind committed Jan 24, 2015
1 parent 8be144a commit 54dfcd3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions 5_1.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,21 @@ func TestStreamConcurrency(ctx *Context) {
http2Conn := CreateHttp2Conn(ctx, true)
defer http2Conn.conn.Close()

var buf bytes.Buffer
hdrs := []hpack.HeaderField{
pair(":method", "GET"),
pair(":scheme", "http"),
pair(":path", "/"),
pair(":authority", ctx.Authority()),
}
enc := hpack.NewEncoder(&buf)
for _, hf := range hdrs {
_ = enc.WriteField(hf)
}
hbf := http2Conn.EncodeHeader(hdrs)

var streamID uint32 = 1
for i := 0; i <= int(ctx.Settings[http2.SettingMaxConcurrentStreams]); i++ {
var hp http2.HeadersFrameParam
hp.StreamID = streamID
hp.EndStream = true
hp.EndHeaders = true
hp.BlockFragment = buf.Bytes()
hp.BlockFragment = hbf
http2Conn.fr.WriteHeaders(hp)
streamID += 2
}
Expand Down

0 comments on commit 54dfcd3

Please sign in to comment.