Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0b8b229

Browse files
author
“ramfox”
committedFeb 4, 2025·
move quinn dependence to dev
1 parent 7842e24 commit 0b8b229

File tree

9 files changed

+179
-242
lines changed

9 files changed

+179
-242
lines changed
 

‎Cargo.lock

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

‎Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ postcard = { version = "1", default-features = false, features = [
5656
] }
5757
quic-rpc = { version = "0.18", optional = true }
5858
quic-rpc-derive = { version = "0.17", optional = true }
59-
quinn = { package = "iroh-quinn", version = "0.13", features = ["ring"] }
6059
rand = "0.8"
6160
range-collections = "0.4.0"
6261
redb = { version = "2.2.0", optional = true }
@@ -82,6 +81,7 @@ tracing-test = "0.2.5"
8281
[dev-dependencies]
8382
http-body = "1.0"
8483
iroh = { version = "0.32", features = ["test-utils"] }
84+
quinn = { package = "iroh-quinn", version = "0.13", features = ["ring"] }
8585
futures-buffered = "0.2.4"
8686
proptest = "1.0.0"
8787
serde_json = "1.0.107"

‎examples/connect/mod.rs

Lines changed: 0 additions & 93 deletions
This file was deleted.

‎examples/custom-protocol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl BlobSearch {
225225
match recv.read_exact(&mut hash_bytes).await {
226226
// FinishedEarly means that the remote side did not send further data,
227227
// so in this case we break our loop.
228-
Err(quinn::ReadExactError::FinishedEarly(_)) => break,
228+
Err(iroh::endpoint::ReadExactError::FinishedEarly(_)) => break,
229229
// Other errors are connection errors, so we bail.
230230
Err(err) => return Err(err.into()),
231231
Ok(_) => {}

‎examples/fetch-fsm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use iroh_blobs::{
1515
use iroh_io::ConcatenateSliceWriter;
1616
use tracing_subscriber::{prelude::*, EnvFilter};
1717

18-
mod connect;
18+
const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0";
1919

2020
// set the RUST_LOG env var to one of {debug,info,warn} to see logging info
2121
pub fn setup_logging() {
@@ -42,7 +42,7 @@ async fn main() -> Result<()> {
4242
// create an endpoint to listen for incoming connections
4343
let endpoint = iroh::Endpoint::builder()
4444
.relay_mode(iroh::RelayMode::Disabled)
45-
.alpns(vec![connect::EXAMPLE_ALPN.into()])
45+
.alpns(vec![EXAMPLE_ALPN.into()])
4646
.bind()
4747
.await?;
4848
println!(
@@ -52,7 +52,7 @@ async fn main() -> Result<()> {
5252
println!("fetching hash {hash} from {:?}", node.node_id);
5353

5454
// connect
55-
let connection = endpoint.connect(node, connect::EXAMPLE_ALPN).await?;
55+
let connection = endpoint.connect(node, EXAMPLE_ALPN).await?;
5656

5757
match format {
5858
BlobFormat::HashSeq => {

‎examples/fetch-stream.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use iroh_blobs::{
1919
use tokio::io::AsyncWriteExt;
2020
use tracing_subscriber::{prelude::*, EnvFilter};
2121

22-
mod connect;
22+
const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0";
2323

2424
// set the RUST_LOG env var to one of {debug,info,warn} to see logging info
2525
pub fn setup_logging() {
@@ -46,7 +46,7 @@ async fn main() -> Result<()> {
4646
// create an endpoint to listen for incoming connections
4747
let endpoint = iroh::Endpoint::builder()
4848
.relay_mode(iroh::RelayMode::Disabled)
49-
.alpns(vec![connect::EXAMPLE_ALPN.into()])
49+
.alpns(vec![EXAMPLE_ALPN.into()])
5050
.bind()
5151
.await?;
5252
println!(
@@ -56,7 +56,7 @@ async fn main() -> Result<()> {
5656
println!("fetching hash {hash} from {:?}", node.node_id);
5757

5858
// connect
59-
let connection = endpoint.connect(node, connect::EXAMPLE_ALPN).await?;
59+
let connection = endpoint.connect(node, EXAMPLE_ALPN).await?;
6060

6161
let mut stream = match format {
6262
BlobFormat::HashSeq => {

‎examples/provide-bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use iroh_blobs::{format::collection::Collection, util::local_pool::LocalPool, Bl
1414
use tracing::warn;
1515
use tracing_subscriber::{prelude::*, EnvFilter};
1616

17-
mod connect;
17+
const EXAMPLE_ALPN: &[u8] = b"n0/iroh/examples/bytes/0";
1818

1919
// set the RUST_LOG env var to one of {debug,info,warn} to see logging info
2020
pub fn setup_logging() {
@@ -69,7 +69,7 @@ async fn main() -> Result<()> {
6969
// create an endpoint to listen for incoming connections
7070
let endpoint = iroh::Endpoint::builder()
7171
.relay_mode(iroh::RelayMode::Disabled)
72-
.alpns(vec![connect::EXAMPLE_ALPN.into()])
72+
.alpns(vec![EXAMPLE_ALPN.into()])
7373
.bind()
7474
.await?;
7575
let addr = endpoint.node_addr().await?;

‎src/get.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::{
2020

2121
use anyhow::Result;
2222
use bao_tree::{io::fsm::BaoContentItem, ChunkNum};
23-
use iroh::endpoint::{self, RecvStream, SendStream};
23+
use iroh::endpoint::{self, ClosedStream, RecvStream, SendStream, WriteError};
2424
use serde::{Deserialize, Serialize};
2525
use tracing::{debug, error};
2626

@@ -189,10 +189,10 @@ pub mod fsm {
189189
RequestTooBig,
190190
/// Error when writing the request to the [`SendStream`].
191191
#[error("write: {0}")]
192-
Write(#[from] quinn::WriteError),
192+
Write(#[from] WriteError),
193193
/// Quic connection is closed.
194194
#[error("closed")]
195-
Closed(#[from] quinn::ClosedStream),
195+
Closed(#[from] ClosedStream),
196196
/// A generic io error
197197
#[error("io {0}")]
198198
Io(io::Error),

‎src/get/error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Error returned from get operations
22
3-
use iroh::endpoint;
3+
use iroh::endpoint::{self, ClosedStream};
44

55
use crate::util::progress::ProgressSendError;
66

@@ -73,7 +73,7 @@ impl From<endpoint::ConnectionError> for GetError {
7373
// TODO(@divma): don't see how this is reachable but let's just not use the peer
7474
GetError::Io(e.into())
7575
}
76-
e @ quinn::ConnectionError::CidsExhausted => {
76+
e @ ConnectionError::CidsExhausted => {
7777
// > The connection could not be created because not enough of the CID space
7878
// > is available
7979
GetError::Io(e.into())
@@ -97,8 +97,8 @@ impl From<endpoint::ReadError> for GetError {
9797
}
9898
}
9999
}
100-
impl From<quinn::ClosedStream> for GetError {
101-
fn from(value: quinn::ClosedStream) -> Self {
100+
impl From<ClosedStream> for GetError {
101+
fn from(value: ClosedStream) -> Self {
102102
GetError::Io(value.into())
103103
}
104104
}

0 commit comments

Comments
 (0)
Please sign in to comment.