File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -115,25 +115,21 @@ func TestStreamConcurrency(ctx *Context) {
115115 http2Conn := CreateHttp2Conn (ctx , true )
116116 defer http2Conn .conn .Close ()
117117
118- var buf bytes.Buffer
119118 hdrs := []hpack.HeaderField {
120119 pair (":method" , "GET" ),
121120 pair (":scheme" , "http" ),
122121 pair (":path" , "/" ),
123122 pair (":authority" , ctx .Authority ()),
124123 }
125- enc := hpack .NewEncoder (& buf )
126- for _ , hf := range hdrs {
127- _ = enc .WriteField (hf )
128- }
124+ hbf := http2Conn .EncodeHeader (hdrs )
129125
130126 var streamID uint32 = 1
131127 for i := 0 ; i <= int (ctx .Settings [http2 .SettingMaxConcurrentStreams ]); i ++ {
132128 var hp http2.HeadersFrameParam
133129 hp .StreamID = streamID
134130 hp .EndStream = true
135131 hp .EndHeaders = true
136- hp .BlockFragment = buf . Bytes ()
132+ hp .BlockFragment = hbf
137133 http2Conn .fr .WriteHeaders (hp )
138134 streamID += 2
139135 }
You can’t perform that action at this time.
0 commit comments