Skip to content

Commit 0130119

Browse files
committed
checkpoint
Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent bea14d5 commit 0130119

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

lading/src/blackhole/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async fn srv(
156156
let mut okay = Response::default();
157157
*okay.status_mut() = status;
158158
*okay.headers_mut() = headers;
159-
*okay.body_mut() = crate::full(body);
159+
*okay.body_mut() = crate::full(body_bytes);
160160
Ok(okay)
161161
}
162162
}

lading/src/generator/http.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
use std::{num::NonZeroU32, thread};
1515

1616
use byte_unit::ByteError;
17-
use hyper::{
18-
client::{Client, HttpConnector},
19-
header::CONTENT_LENGTH,
20-
Body, HeaderMap, Request, Uri,
21-
};
17+
use hyper::{header::CONTENT_LENGTH, HeaderMap, Request, Uri};
18+
use hyper_util::{client::legacy::Client, rt::TokioExecutor};
2219
use lading_throttle::Throttle;
2320
use metrics::{counter, gauge};
2421
use once_cell::sync::OnceCell;
@@ -193,7 +190,7 @@ impl Http {
193190
/// Function will panic if it is unable to create HTTP requests for the
194191
/// target.
195192
pub async fn spin(mut self) -> Result<(), Error> {
196-
let client: Client<HttpConnector, Body> = Client::builder()
193+
let client = Client::builder(TokioExecutor::new())
197194
.pool_max_idle_per_host(self.parallel_connections as usize)
198195
.retry_canceled_requests(false)
199196
.build_http();
@@ -214,10 +211,10 @@ impl Http {
214211
let blk = rcv.next().await.expect("block cache should never be empty");
215212
let total_bytes = blk.total_bytes;
216213

217-
let body = Body::from(blk.bytes.clone());
214+
let body = crate::full(blk.bytes.clone());
218215
let block_length = blk.bytes.len();
219216

220-
let mut request: Request<Body> = Request::builder()
217+
let mut request = Request::builder()
221218
.method(method.clone())
222219
.uri(&uri)
223220
.header(CONTENT_LENGTH, block_length)

0 commit comments

Comments
 (0)