Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use into_data_stream instead of the custom complicated wrapper #2408

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
7 changes: 1 addition & 6 deletions Cargo.Bazel.Fuzzing.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "7661b2c9fdc930e58622dc8df6307c9e805eb95556ad2b11b93ca0561235524a",
"checksum": "a944774f76fd863addc246ea846e7ce2d528289902b32e913abf021c2dabadc1",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -19326,10 +19326,6 @@
"id": "syn 1.0.109",
"target": "syn"
},
{
"id": "sync_wrapper 1.0.1",
"target": "sync_wrapper"
},
{
"id": "tar 0.4.39",
"target": "tar"
Expand Down Expand Up @@ -85566,7 +85562,6 @@
"stubborn-io 0.3.2",
"subtle 2.6.1",
"syn 1.0.109",
"sync_wrapper 1.0.1",
"tar 0.4.39",
"tarpc 0.34.0",
"tempfile 3.12.0",
Expand Down
1 change: 0 additions & 1 deletion Cargo.Bazel.Fuzzing.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3244,7 +3244,6 @@ dependencies = [
"stubborn-io",
"subtle",
"syn 1.0.109",
"sync_wrapper 1.0.1",
"tar",
"tarpc",
"tempfile",
Expand Down
7 changes: 1 addition & 6 deletions Cargo.Bazel.json.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"checksum": "d4b611a5f338012769866b27437875353f5d76dbabb9b135418806599a3b8912",
"checksum": "a21d4243de1c16fbbeea6a2220ad62857326adde7983b85ed3109386d7f30362",
"crates": {
"abnf 0.12.0": {
"name": "abnf",
Expand Down Expand Up @@ -19149,10 +19149,6 @@
"id": "syn 1.0.109",
"target": "syn"
},
{
"id": "sync_wrapper 1.0.1",
"target": "sync_wrapper"
},
{
"id": "tar 0.4.39",
"target": "tar"
Expand Down Expand Up @@ -85439,7 +85435,6 @@
"stubborn-io 0.3.2",
"subtle 2.6.1",
"syn 1.0.109",
"sync_wrapper 1.0.1",
"tar 0.4.39",
"tarpc 0.34.0",
"tempfile 3.12.0",
Expand Down
1 change: 0 additions & 1 deletion Cargo.Bazel.toml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3233,7 +3233,6 @@ dependencies = [
"stubborn-io",
"subtle",
"syn 1.0.109",
"sync_wrapper 1.0.1",
"tar",
"tarpc",
"tempfile",
Expand Down
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,6 @@ strum = { version = "0.26.3", features = ["derive"] }
strum_macros = "0.26.4"
subtle = "2.6.1"
syn = { version = "1.0.109", features = ["fold", "full"] }
sync_wrapper = "1.0.1"
tar = "0.4.39"
tempfile = "3.12.0"
thiserror = "1.0.62"
Expand Down
3 changes: 0 additions & 3 deletions bazel/external_crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1196,9 +1196,6 @@ def external_crates_repository(name, cargo_lockfile, lockfile, sanitizers_enable
"full",
],
),
"sync_wrapper": crate.spec(
version = "^1.0.1",
),
"tar": crate.spec(
version = "^0.4.38",
),
Expand Down
3 changes: 0 additions & 3 deletions rs/async_utils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,12 @@ rust_library(
# Keep sorted.
"@crate_index//:anyhow",
"@crate_index//:async-stream",
"@crate_index//:axum",
"@crate_index//:byte-unit",
"@crate_index//:bytes",
"@crate_index//:futures",
"@crate_index//:futures-util",
"@crate_index//:hyper",
"@crate_index//:slog",
"@crate_index//:sync_wrapper",
"@crate_index//:thiserror",
"@crate_index//:tokio",
"@crate_index//:tonic",
],
Expand Down
3 changes: 0 additions & 3 deletions rs/async_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ documentation.workspace = true
[dependencies]
anyhow = { workspace = true }
async-stream = { workspace = true }
axum = { workspace = true }
byte-unit = "4.0.14"
bytes = { workspace = true }
futures = { workspace = true }
futures-util = { workspace = true }
hyper = { workspace = true }
slog = { workspace = true }
sync_wrapper = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tonic = { workspace = true }

Expand Down
42 changes: 0 additions & 42 deletions rs/async_utils/src/axum.rs

This file was deleted.

1 change: 0 additions & 1 deletion rs/async_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use slog::{info, Logger};

pub mod axum;
mod hyper;
mod join_map;
mod unix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ load("@rules_rust//rust:defs.bzl", "rust_binary")

DEPENDENCIES = [
# Keep sorted.
"//rs/async_utils",
"@crate_index//:anyhow",
"@crate_index//:axum",
"@crate_index//:clap",
Expand Down
1 change: 0 additions & 1 deletion rs/boundary_node/systemd_journal_gatewayd_shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ async-trait = { workspace = true }
axum = { workspace = true }
clap = { workspace = true }
http = { workspace = true }
ic-async-utils = { path = "../../async_utils" }
itertools = { workspace = true }
reqwest = { workspace = true }
thiserror = { workspace = true }
Expand Down
3 changes: 1 addition & 2 deletions rs/boundary_node/systemd_journal_gatewayd_shim/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use axum::{
http::StatusCode,
response::{IntoResponse, Response},
};
use ic_async_utils::axum::BodyDataStream;
use itertools::{concat, Itertools};
use reqwest::Method;
use url::Url;
Expand Down Expand Up @@ -93,7 +92,7 @@ pub(crate) async fn entries(
});

let (parts, body) = req.into_parts();
let body_stream = BodyDataStream::new(body);
let body_stream = body.into_data_stream();

let mut upstream_req = reqwest::Request::new(Method::GET, u);

Expand Down
3 changes: 1 addition & 2 deletions rs/tests/src/nns_tests/registry_authentication_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use axum::{
extract::{Request, State},
routing::any,
};
use ic_async_utils::axum::BodyDataStream;
use ic_crypto_utils_threshold_sig_der::threshold_sig_public_key_from_der;
use ic_nns_test_utils::itest_helpers::{
forward_call_via_universal_canister, set_up_universal_canister,
Expand Down Expand Up @@ -188,7 +187,7 @@ async fn mitm_service(

let (parts, body) = req.into_parts();
*request.headers_mut() = parts.headers;
*request.body_mut() = Some(reqwest::Body::wrap_stream(BodyDataStream::new(body)));
*request.body_mut() = Some(reqwest::Body::wrap_stream(body.into_data_stream()));

let response = client
.execute(request)
Expand Down
Loading