@@ -140,7 +140,6 @@ fn http2_parallel_x10_req_10mb(b: &mut test::Bencher) {
140
140
}
141
141
142
142
#[ bench]
143
- #[ ignore]
144
143
fn http2_parallel_x10_req_10kb_100_chunks ( b : & mut test:: Bencher ) {
145
144
let body = & [ b'x' ; 1024 * 10 ] ;
146
145
opts ( )
@@ -152,7 +151,6 @@ fn http2_parallel_x10_req_10kb_100_chunks(b: &mut test::Bencher) {
152
151
}
153
152
154
153
#[ bench]
155
- #[ ignore]
156
154
fn http2_parallel_x10_req_10kb_100_chunks_adaptive_window ( b : & mut test:: Bencher ) {
157
155
let body = & [ b'x' ; 1024 * 10 ] ;
158
156
opts ( )
@@ -165,7 +163,6 @@ fn http2_parallel_x10_req_10kb_100_chunks_adaptive_window(b: &mut test::Bencher)
165
163
}
166
164
167
165
#[ bench]
168
- #[ ignore]
169
166
fn http2_parallel_x10_req_10kb_100_chunks_max_window ( b : & mut test:: Bencher ) {
170
167
let body = & [ b'x' ; 1024 * 10 ] ;
171
168
opts ( )
@@ -294,7 +291,7 @@ impl Opts {
294
291
. build ( )
295
292
. expect ( "rt build" ) ,
296
293
) ;
297
- // let exec = rt.clone();
294
+ let exec = rt. clone ( ) ;
298
295
299
296
let req_len = self . request_body . map ( |b| b. len ( ) ) . unwrap_or ( 0 ) as u64 ;
300
297
let req_len = if self . request_chunks > 0 {
@@ -344,19 +341,21 @@ impl Opts {
344
341
let make_request = || {
345
342
let chunk_cnt = self . request_chunks ;
346
343
let body = if chunk_cnt > 0 {
347
- /*
348
- let (mut tx, body) = Body::channel();
344
+ let ( mut tx , rx ) = futures_channel :: mpsc :: channel ( 0 ) ;
345
+
349
346
let chunk = self
350
347
. request_body
351
348
. expect ( "request_chunks means request_body" ) ;
352
349
exec. spawn ( async move {
350
+ use futures_util:: SinkExt ;
351
+ use hyper:: body:: Frame ;
353
352
for _ in 0 ..chunk_cnt {
354
- tx.send_data(chunk.into()).await.expect("send_data");
353
+ tx. send ( Ok ( Frame :: data ( bytes:: Bytes :: from ( chunk) ) ) )
354
+ . await
355
+ . expect ( "send_data" ) ;
355
356
}
356
357
} ) ;
357
- body
358
- */
359
- todo ! ( "request_chunks" ) ;
358
+ http_body_util:: StreamBody :: new ( rx) . boxed ( )
360
359
} else if let Some ( chunk) = self . request_body {
361
360
http_body_util:: Full :: new ( bytes:: Bytes :: from ( chunk) ) . boxed ( )
362
361
} else {
0 commit comments