Skip to content

Commit 6a4053e

Browse files
committed
Update audio to hyper 1.x
1 parent 0a7a874 commit 6a4053e

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

audio/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ bytes = "1"
1919
ctr = "0.9"
2020
futures-core = "0.3"
2121
futures-util = "0.3"
22-
hyper = { version = "0.14", features = ["client", "backports", "deprecated"] }
22+
hyper = { version = "1.3", features = [] }
23+
hyper-util = { version = "0.1", features = ["client"] }
24+
http-body-util = "0.1.1"
2325
log = "0.4"
2426
parking_lot = { version = "0.12", features = ["deadlock_detection"] }
2527
tempfile = "3"

audio/src/fetch/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use std::{
1212
};
1313

1414
use futures_util::{future::IntoStream, StreamExt, TryFutureExt};
15-
use hyper::{client::ResponseFuture, header::CONTENT_RANGE, Body, Response, StatusCode};
15+
use hyper::{body::Incoming, header::CONTENT_RANGE, Response, StatusCode};
16+
use hyper_util::client::legacy::ResponseFuture;
1617
use parking_lot::{Condvar, Mutex};
1718
use tempfile::NamedTempFile;
1819
use thiserror::Error;
@@ -133,7 +134,7 @@ pub enum AudioFile {
133134
#[derive(Debug)]
134135
pub struct StreamingRequest {
135136
streamer: IntoStream<ResponseFuture>,
136-
initial_response: Option<Response<Body>>,
137+
initial_response: Option<Response<Incoming>>,
137138
offset: usize,
138139
length: usize,
139140
}

audio/src/fetch/receive.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ use std::{
77

88
use bytes::Bytes;
99
use futures_util::StreamExt;
10-
use hyper::{body::HttpBody, StatusCode};
10+
use hyper::StatusCode;
1111
use tempfile::NamedTempFile;
1212
use tokio::sync::{mpsc, oneshot};
13+
use http_body_util::BodyExt;
1314

1415
use librespot_core::{http_client::HttpClient, session::Session, Error};
1516

0 commit comments

Comments
 (0)