Skip to content

Commit a5b664f

Browse files
committed
update deps
1 parent 5ac03f9 commit a5b664f

File tree

26 files changed

+1195
-881
lines changed

26 files changed

+1195
-881
lines changed

Cargo.lock

Lines changed: 1022 additions & 742 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,45 +45,48 @@ glob = "0.3"
4545
hiercmd = { git = "https://github.com/jclulow/hiercmd" }
4646
hmac-sha256 = "1"
4747
html-escape = "0.2"
48-
http = "0.2"
48+
http = "1"
49+
http-body-util = "0.1"
4950
http-range = "0.1"
50-
hyper = "0.14"
51+
hyper = "1"
5152
ipnet = "2.8"
5253
jmclib = { git = "https://github.com/jclulow/rust-jmclib", features = ["sqlite"] }
5354
libc = "0.2.113"
5455
new_mime_guess = "4"
5556
octorust = { git = "https://github.com/oxidecomputer/third-party-api-clients", branch = "jclulow" }
56-
pem = "2"
57+
pem = "3"
5758
percent-encoding = "2.1"
58-
progenitor = { git = "https://github.com/oxidecomputer/progenitor" }
59+
progenitor = { version = "0.9.1" }
60+
progenitor-client = { version = "0.9.1" }
5961
rand = "0.8"
6062
regex = "1"
61-
reqwest = { version = "0.11", features = [ "json", "stream" ] }
63+
reqwest = { version = "0.12", features = [ "json", "stream" ] }
6264
rust-toolchain-file = "0.1"
63-
rusty_ulid = "1"
65+
rusty_ulid = "2"
6466
schemars = { version = "0.8", features = [ "chrono" ] }
65-
sea-query = { version = "0.30", default-features = false, features = [ "derive", "attr", "backend-sqlite" ] }
66-
sea-query-rusqlite = "0.5"
67+
sea-query = { version = "0.32", default-features = false, features = [ "derive", "attr", "backend-sqlite" ] }
68+
sea-query-rusqlite = "0.7"
69+
semver = "1"
6770
serde = { version = "1", features = [ "derive" ] }
6871
serde_json = "1"
6972
serde_repr = "0.1"
7073
serde_urlencoded = "0.7"
71-
serde_with = "1.10"
74+
serde_with = "3"
7275
serde_yaml = "0.9"
7376
sigpipe = "0.1"
7477
slog = { version = "2.7", features = [ "release_max_level_debug" ] }
7578
slog-bunyan = "2.4"
7679
slog-term = "2.7"
7780
smf = { git = "https://github.com/illumos/smf-rs.git" }
7881
strip-ansi-escapes = "0.2"
79-
strum = { version = "0.25", features = [ "derive" ] }
82+
strum = { version = "0.26", features = [ "derive" ] }
8083
tempfile = "3.3"
81-
thiserror = "1"
84+
thiserror = "2"
8285
tlvc = { git = "https://github.com/oxidecomputer/tlvc", version = "0.3.1" }
8386
tlvc-text = { git = "https://github.com/oxidecomputer/tlvc", version = "0.3.0" }
8487
tokio = { version = "1", features = [ "full" ] }
8588
tokio-stream = "0.1"
86-
tokio-util = { version = "0.6.9", features = [ "io" ] }
89+
tokio-util = { version = "0.7", features = [ "io" ] }
8790
toml = "0.8"
8891
usdt = "0.5"
8992
zone = { version = "0.3", features = [ "async" ], default-features = false }

client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ anyhow = { workspace = true }
1414
chrono = { workspace = true }
1515
futures = { workspace = true }
1616
progenitor = { workspace = true }
17+
progenitor-client = { workspace = true }
1718
reqwest = { workspace = true }
1819
rusty_ulid = { workspace = true }
1920
serde = { workspace = true }

database/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,12 +325,14 @@ macro_rules! sqlite_ulid_new_type {
325325
}
326326

327327
pub fn datetime(&self) -> chrono::DateTime<chrono::Utc> {
328-
self.0.datetime()
328+
chrono::DateTime::from_timestamp_millis(
329+
self.0.timestamp().try_into().unwrap()
330+
).unwrap()
329331
}
330332

331333
pub fn age(&self) -> std::time::Duration {
332334
chrono::Utc::now()
333-
.signed_duration_since(self.0.datetime())
335+
.signed_duration_since(self.datetime())
334336
.to_std()
335337
.unwrap_or_else(|_| std::time::Duration::from_secs(0))
336338
}

download/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ aws-sdk-s3 = { workspace = true }
1313
bytes = { workspace = true }
1414
dropshot = { workspace = true }
1515
futures = { workspace = true }
16+
http-body-util = { workspace = true }
1617
http-range = { workspace = true }
1718
hyper = { workspace = true }
1819
reqwest = { workspace = true }

download/src/kinds/file.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ use std::os::unix::fs::FileExt;
99

1010
use anyhow::Result;
1111
use bytes::BytesMut;
12-
use hyper::{Body, Response};
12+
use dropshot::Body;
13+
use hyper::{body::Frame, Response};
1314
use slog::{o, Logger};
1415
use tokio::sync::mpsc;
1516

@@ -128,7 +129,7 @@ pub async fn stream_from_file(
128129
*/
129130
let buf = buf.freeze();
130131
sw.add_bytes(buf.len());
131-
if tx.send(Ok(buf)).await.is_err() {
132+
if tx.send(Ok(Frame::data(buf))).await.is_err() {
132133
sw.fail(&log, "interrupted on client side").ok();
133134
return;
134135
}

download/src/kinds/s3.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
use super::sublude::*;
66

77
use anyhow::{anyhow, bail, Result};
8-
use hyper::{Body, Response};
8+
use dropshot::Body;
9+
use hyper::{body::Frame, Response};
910
use slog::{o, Logger};
1011
use tokio::sync::mpsc;
1112

@@ -156,7 +157,7 @@ pub async fn stream_from_s3(
156157
* Pass the read bytes onto the client.
157158
*/
158159
sw.add_bytes(data.len());
159-
if tx.send(Ok(data)).await.is_err() {
160+
if tx.send(Ok(Frame::data(data))).await.is_err() {
160161
sw.fail(&log, "interrupted on client side").ok();
161162
return;
162163
}

download/src/kinds/url.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ use super::sublude::*;
66

77
use anyhow::{anyhow, bail, Result};
88

9+
use dropshot::Body;
910
use futures::TryStreamExt;
1011
use hyper::{
12+
body::Frame,
1113
header::{CONTENT_LENGTH, CONTENT_RANGE, RANGE},
12-
Body, Response, StatusCode,
14+
Response, StatusCode,
1315
};
1416
use slog::{o, Logger};
1517
use tokio::sync::mpsc;
@@ -200,7 +202,7 @@ pub async fn stream_from_url(
200202
* Pass the read bytes onto the client.
201203
*/
202204
sw.add_bytes(data.len());
203-
if tx.send(Ok(data)).await.is_err() {
205+
if tx.send(Ok(Frame::data(data))).await.is_err() {
204206
sw.fail(&log, "interrupted on client side").ok();
205207
return;
206208
}

download/src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
use anyhow::Result;
66
use bytes::Bytes;
77

8+
use dropshot::Body;
9+
use http_body_util::StreamBody;
810
use hyper::{
11+
body::Frame,
912
header::{ACCEPT_RANGES, CONTENT_LENGTH, CONTENT_RANGE, CONTENT_TYPE},
10-
Body, Response, StatusCode,
13+
Response, StatusCode,
1114
};
1215

1316
use tokio::sync::mpsc;
@@ -24,7 +27,7 @@ fn bad_range_response(file_size: u64) -> Response<Body> {
2427
.status(StatusCode::RANGE_NOT_SATISFIABLE)
2528
.header(ACCEPT_RANGES, "bytes")
2629
.header(CONTENT_RANGE, format!("bytes */{file_size}"))
27-
.body(hyper::Body::empty())
30+
.body(Body::wrap(http_body_util::Empty::new()))
2831
.unwrap()
2932
}
3033

@@ -37,7 +40,7 @@ fn make_get_response<E>(
3740
crange: Option<SingleRange>,
3841
file_length: u64,
3942
content_type: Option<&str>,
40-
rx: mpsc::Receiver<std::result::Result<Bytes, E>>,
43+
rx: mpsc::Receiver<std::result::Result<Frame<Bytes>, E>>,
4144
) -> Result<Response<Body>>
4245
where
4346
E: Into<Box<(dyn std::error::Error + Send + Sync + 'static)>>
@@ -46,7 +49,9 @@ where
4649
+ 'static,
4750
{
4851
Ok(make_response_common(crange, file_length, content_type)?.body(
49-
Body::wrap_stream(tokio_stream::wrappers::ReceiverStream::new(rx)),
52+
Body::wrap(StreamBody::new(
53+
tokio_stream::wrappers::ReceiverStream::new(rx),
54+
)),
5055
)?)
5156
}
5257

@@ -61,7 +66,7 @@ fn make_head_response(
6166
content_type: Option<&str>,
6267
) -> Result<Response<Body>> {
6368
Ok(make_response_common(crange, file_length, content_type)?
64-
.body(Body::empty())?)
69+
.body(Body::wrap(http_body_util::Empty::new()))?)
6570
}
6671

6772
fn make_response_common(

download/src/stopwatch.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::time::{Duration, Instant};
66

77
use anyhow::{anyhow, Result};
88
use bytes::Bytes;
9+
use hyper::body::Frame;
910
use slog::{error, info, Logger};
1011

1112
pub struct Stopwatch {
@@ -51,7 +52,7 @@ impl Stopwatch {
5152
);
5253
}
5354

54-
pub fn fail(self, log: &Logger, how: &str) -> Result<Bytes> {
55+
pub fn fail(self, log: &Logger, how: &str) -> Result<Frame<Bytes>> {
5556
let (dur, rate_mb) = self.complete_common();
5657
let msg = format!("download failed: {}: {}", self.info, how);
5758

0 commit comments

Comments
 (0)