Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Brian L. Troutwine <[email protected]>
  • Loading branch information
blt committed Dec 27, 2024
1 parent b80bc41 commit e47fa0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lading/src/blackhole/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async fn srv(
let mut okay = Response::default();
*okay.status_mut() = status;
*okay.headers_mut() = headers;
*okay.body_mut() = crate::full(body);
*okay.body_mut() = crate::full(body_bytes);
Ok(okay)
}
}
Expand Down
13 changes: 5 additions & 8 deletions lading/src/generator/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
use std::{num::NonZeroU32, thread};

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

let body = Body::from(blk.bytes.clone());
let body = crate::full(blk.bytes.clone());
let block_length = blk.bytes.len();

let mut request: Request<Body> = Request::builder()
let mut request = Request::builder()
.method(method.clone())
.uri(&uri)
.header(CONTENT_LENGTH, block_length)
Expand Down

0 comments on commit e47fa0f

Please sign in to comment.