Skip to content

Commit

Permalink
refactor(app/test): remove unused http_util::connect_and_accept(..)
Browse files Browse the repository at this point in the history
this removes `connect_and_accept(..)`. this will break fuzzing builds,
but it is not used elsewhere.

Signed-off-by: katelyn martin <[email protected]>
  • Loading branch information
cratelyn committed Dec 13, 2024
1 parent 0aaf7c0 commit 7fef948
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions linkerd/app/test/src/http_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,6 @@ use tracing::Instrument;

type BoxServer = svc::BoxTcp<io::DuplexStream>;

/// Connects a client and server, running a proxy between them.
///
/// Returns a tuple containing (1) a [`SendRequest`] that can be used to transmit a request and
/// await a response, and (2) a [`JoinSet<T>`] running background tasks.
#[allow(deprecated)] // linkerd/linkerd2#8733
pub async fn connect_and_accept(
client_settings: &mut hyper::client::conn::Builder,
server: BoxServer,
) -> (
hyper::client::conn::SendRequest<hyper::Body>,
JoinSet<Result<(), Error>>,
) {
tracing::info!(settings = ?client_settings, "connecting client with");
let (client_io, server_io) = io::duplex(4096);

let (client, conn) = client_settings
.handshake(client_io)
.await
.expect("Client must connect");

let mut bg = tokio::task::JoinSet::new();
bg.spawn(
async move {
server
.oneshot(server_io)
.await
.map_err(ContextError::ctx("proxy background task failed"))?;
tracing::info!("proxy serve task complete");
Ok(())
}
.instrument(tracing::info_span!("proxy")),
);
bg.spawn(
async move {
conn.await
.map_err(ContextError::ctx("client background task failed"))
.map_err(Error::from)?;
tracing::info!("client background complete");
Ok(())
}
.instrument(tracing::info_span!("client_bg")),
);

(client, bg)
}

/// Connects a client and server, running a proxy between them.
///
/// Returns a tuple containing (1) a [`SendRequest`] that can be used to transmit a request and
Expand Down

0 comments on commit 7fef948

Please sign in to comment.