mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 04:46:29 +03:00
chore: update iroh from 0.33.0 to 0.35.0 (#6687)
This commit is contained in:
@@ -95,6 +95,7 @@ impl BackupProvider {
|
||||
pub async fn prepare(context: &Context) -> Result<Self> {
|
||||
let relay_mode = RelayMode::Disabled;
|
||||
let endpoint = Endpoint::builder()
|
||||
.tls_x509() // For compatibility with iroh <0.34.0
|
||||
.alpns(vec![BACKUP_ALPN.to_vec()])
|
||||
.relay_mode(relay_mode)
|
||||
.bind()
|
||||
@@ -301,7 +302,11 @@ pub async fn get_backup2(
|
||||
) -> Result<()> {
|
||||
let relay_mode = RelayMode::Disabled;
|
||||
|
||||
let endpoint = Endpoint::builder().relay_mode(relay_mode).bind().await?;
|
||||
let endpoint = Endpoint::builder()
|
||||
.tls_x509() // For compatibility with iroh <0.34.0
|
||||
.relay_mode(relay_mode)
|
||||
.bind()
|
||||
.await?;
|
||||
|
||||
let conn = endpoint.connect(node_addr, BACKUP_ALPN).await?;
|
||||
let (mut send_stream, mut recv_stream) = conn.open_bi().await?;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
use anyhow::{anyhow, bail, Context as _, Result};
|
||||
use data_encoding::BASE32_NOPAD;
|
||||
use futures_lite::StreamExt;
|
||||
use iroh::{Endpoint, NodeAddr, NodeId, PublicKey, RelayMap, RelayMode, RelayUrl, SecretKey};
|
||||
use iroh::{Endpoint, NodeAddr, NodeId, PublicKey, RelayMode, RelayUrl, SecretKey};
|
||||
use iroh_gossip::net::{Event, Gossip, GossipEvent, JoinOptions, GOSSIP_ALPN};
|
||||
use iroh_gossip::proto::TopicId;
|
||||
use parking_lot::Mutex;
|
||||
@@ -245,7 +245,7 @@ impl Context {
|
||||
.as_ref()
|
||||
.and_then(|conf| conf.iroh_relay.clone())
|
||||
{
|
||||
RelayMode::Custom(RelayMap::from_url(RelayUrl::from(relay_url)))
|
||||
RelayMode::Custom(RelayUrl::from(relay_url).into())
|
||||
} else {
|
||||
// FIXME: this should be RelayMode::Disabled instead.
|
||||
// Currently using default relays because otherwise Rust tests fail.
|
||||
@@ -253,6 +253,7 @@ impl Context {
|
||||
};
|
||||
|
||||
let endpoint = Endpoint::builder()
|
||||
.tls_x509() // For compatibility with iroh <0.34.0
|
||||
.secret_key(secret_key)
|
||||
.alpns(vec![GOSSIP_ALPN.to_vec()])
|
||||
.relay_mode(relay_mode)
|
||||
@@ -271,8 +272,7 @@ impl Context {
|
||||
|
||||
let router = iroh::protocol::Router::builder(endpoint)
|
||||
.accept(GOSSIP_ALPN, gossip.clone())
|
||||
.spawn()
|
||||
.await?;
|
||||
.spawn();
|
||||
|
||||
Ok(Iroh {
|
||||
router,
|
||||
|
||||
@@ -4,6 +4,7 @@ pub(crate) mod data;
|
||||
|
||||
use anyhow::Result;
|
||||
use deltachat_contact_tools::EmailAddress;
|
||||
use hickory_resolver::name_server::TokioConnectionProvider;
|
||||
use hickory_resolver::{config, Resolver, TokioResolver};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
@@ -179,14 +180,14 @@ impl ProviderOptions {
|
||||
/// This does not work at least on some Androids, therefore we fallback
|
||||
/// to the default `ResolverConfig` which uses eg. to google's `8.8.8.8` or `8.8.4.4`.
|
||||
fn get_resolver() -> Result<TokioResolver> {
|
||||
if let Ok(resolver) = Resolver::tokio_from_system_conf() {
|
||||
return Ok(resolver);
|
||||
if let Ok(resolver) = TokioResolver::builder_tokio() {
|
||||
return Ok(resolver.build());
|
||||
}
|
||||
let resolver = Resolver::tokio(
|
||||
let resolver = Resolver::builder_with_config(
|
||||
config::ResolverConfig::default(),
|
||||
config::ResolverOpts::default(),
|
||||
TokioConnectionProvider::default(),
|
||||
);
|
||||
Ok(resolver)
|
||||
Ok(resolver.build())
|
||||
}
|
||||
|
||||
/// Returns provider for the given an e-mail address.
|
||||
|
||||
Reference in New Issue
Block a user