Skip to content

Commit d538b11

Browse files
Frandorklaehndignifiedquire
authored
multipath: merge main (#3674)
## Description Merges main and adapts for the changes from #3619 ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist <!-- Remove any that are not relevant. --> - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. - [ ] List all breaking changes in the above "Breaking Changes" section. - [ ] Open an issue or PR on any number0 repos that are affected by this breaking change. Give guidance on how the updates should be handled or do the actual updates themselves. The major ones are: - [ ] [`quic-rpc`](https://github.com/n0-computer/quic-rpc) - [ ] [`iroh-gossip`](https://github.com/n0-computer/iroh-gossip) - [ ] [`iroh-blobs`](https://github.com/n0-computer/iroh-blobs) - [ ] [`dumbpipe`](https://github.com/n0-computer/dumbpipe) - [ ] [`sendme`](https://github.com/n0-computer/sendme) --------- Co-authored-by: Rüdiger Klaehn <rklaehn@protonmail.com> Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
1 parent 34f52c6 commit d538b11

File tree

6 files changed

+212
-700
lines changed

6 files changed

+212
-700
lines changed

iroh/src/discovery.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -893,12 +893,10 @@ mod tests {
893893
let (ep2, _guard2) =
894894
new_endpoint(&mut rng, |ep| disco_shared.create_discovery(ep.id())).await;
895895

896-
let ep1_wrong_addr = EndpointAddr {
897-
id: ep1.id(),
898-
addrs: [TransportAddr::Ip("240.0.0.1:1000".parse().unwrap())]
899-
.into_iter()
900-
.collect(),
901-
};
896+
let ep1_wrong_addr = EndpointAddr::from_parts(
897+
ep1.id(),
898+
[TransportAddr::Ip("240.0.0.1:1000".parse().unwrap())],
899+
);
902900
let _conn = ep2.connect(ep1_wrong_addr, TEST_ALPN).await?;
903901
Ok(())
904902
}
@@ -1043,10 +1041,7 @@ mod test_dns_pkarr {
10431041
.await?;
10441042
println!("resolved {resolved:?}");
10451043

1046-
let expected_addr = EndpointAddr {
1047-
id: endpoint_id,
1048-
addrs: relay_url.into_iter().collect(),
1049-
};
1044+
let expected_addr = EndpointAddr::from_parts(endpoint_id, relay_url);
10501045

10511046
assert_eq!(resolved.to_endpoint_addr(), expected_addr);
10521047
assert_eq!(resolved.user_data(), Some(&user_data));

iroh/src/discovery/static_provider.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,10 @@ mod tests {
248248
.await?;
249249

250250
let key = SecretKey::from_bytes(&[0u8; 32]);
251-
let addr = EndpointAddr {
252-
id: key.public(),
253-
addrs: [TransportAddr::Relay("https://example.com".parse()?)]
254-
.into_iter()
255-
.collect(),
256-
};
251+
let addr = EndpointAddr::from_parts(
252+
key.public(),
253+
[TransportAddr::Relay("https://example.com".parse()?)],
254+
);
257255
let user_data = Some("foobar".parse().unwrap());
258256
let endpoint_info = EndpointInfo::from(addr.clone()).with_user_data(user_data.clone());
259257
discovery.add_endpoint_info(endpoint_info.clone());
@@ -280,12 +278,10 @@ mod tests {
280278
async fn test_provenance() -> Result {
281279
let discovery = StaticProvider::with_provenance("foo");
282280
let key = SecretKey::from_bytes(&[0u8; 32]);
283-
let addr = EndpointAddr {
284-
id: key.public(),
285-
addrs: [TransportAddr::Relay("https://example.com".parse()?)]
286-
.into_iter()
287-
.collect(),
288-
};
281+
let addr = EndpointAddr::from_parts(
282+
key.public(),
283+
[TransportAddr::Relay("https://example.com".parse()?)],
284+
);
289285
discovery.add_endpoint_info(addr);
290286
let mut stream = discovery.resolve(key.public()).unwrap();
291287
let item = stream.next().await.unwrap()?;

iroh/src/endpoint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ pub use quinn_proto::{
6969

7070
pub use self::connection::{
7171
Accept, Accepting, AlpnError, AuthenticationError, Connecting, ConnectingError, Connection,
72-
Incoming, IncomingZeroRttConnection, OutgoingZeroRttConnection, RemoteEndpointIdError,
73-
ZeroRttStatus,
72+
ConnectionState, HandshakeCompleted, Incoming, IncomingZeroRtt, IncomingZeroRttConnection,
73+
OutgoingZeroRtt, OutgoingZeroRttConnection, RemoteEndpointIdError, ZeroRttStatus,
7474
};
7575
pub use crate::magicsock::transports::TransportConfig;
7676

0 commit comments

Comments
 (0)