build: update iroh to 0.92.0

This commit is contained in:
link2xt
2025-10-02 13:39:49 +00:00
parent 3c8dc6efd2
commit f83d70b05b
4 changed files with 48 additions and 54 deletions

View File

@@ -33,7 +33,7 @@ use std::task::Poll;
use anyhow::{Context as _, Result, bail, format_err};
use futures_lite::FutureExt;
use iroh::{Endpoint, RelayMode};
use iroh::{Endpoint, RelayMode, Watcher as _};
use tokio::fs;
use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
@@ -96,12 +96,11 @@ 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()
.await?;
let node_addr = endpoint.node_addr().await?;
let node_addr = endpoint.node_addr().initialized().await;
// Acquire global "ongoing" mutex.
let cancel_token = context.alloc_ongoing().await?;
@@ -304,11 +303,7 @@ pub async fn get_backup2(
) -> Result<()> {
let relay_mode = RelayMode::Disabled;
let endpoint = Endpoint::builder()
.tls_x509() // For compatibility with iroh <0.34.0
.relay_mode(relay_mode)
.bind()
.await?;
let endpoint = Endpoint::builder().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?;