Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions linkerd/app/test/src/http_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/// 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

Check warning on line 14 in linkerd/app/test/src/http_util.rs

View workflow job for this annotation

GitHub Actions / rust

warning: unresolved link to `SendRequest` --> linkerd/app/test/src/http_util.rs:14:40 | 14 | /// Returns a tuple containing (1) a [`SendRequest`] that can be used to transmit a request and | ^^^^^^^^^^^ no item named `SendRequest` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]` = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
/// await a response, and (2) a [`JoinSet<T>`] running background tasks.
pub async fn connect_and_accept_http1(
client_settings: &mut hyper::client::conn::http1::Builder,
Expand Down Expand Up @@ -54,54 +54,9 @@
(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
/// await a response, and (2) a [`JoinSet<T>`] running background tasks.
pub async fn connect_and_accept_http1(
client_settings: &mut hyper::client::conn::http1::Builder,
server: BoxServer,
) -> (
hyper::client::conn::http1::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

Check warning on line 59 in linkerd/app/test/src/http_util.rs

View workflow job for this annotation

GitHub Actions / rust

warning: unresolved link to `SendRequest` --> linkerd/app/test/src/http_util.rs:59:40 | 59 | /// Returns a tuple containing (1) a [`SendRequest`] that can be used to transmit a request and | ^^^^^^^^^^^ no item named `SendRequest` in scope | = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
/// await a response, and (2) a [`JoinSet<T>`] running background tasks.
pub async fn connect_and_accept_http2<B>(
client_settings: &mut hyper::client::conn::http2::Builder,
Expand Down
Loading