Add timeout to provisioning socket connection

This commit is contained in:
nab138
2026-02-15 13:01:43 -05:00
parent 14e22ba218
commit e7263b982b
3 changed files with 10 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -1831,7 +1831,7 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
[[package]]
name = "isideload"
version = "0.2.5"
version = "0.2.6"
dependencies = [
"aes 0.9.0-rc.4",
"aes-gcm",

View File

@@ -3,7 +3,7 @@ name = "isideload"
description = "Sideload iOS/iPadOS applications"
license = "MIT"
authors = ["Nicholas Sharp <nab@nabdev.me>"]
version = "0.2.5"
version = "0.2.6"
edition = "2024"
repository = "https://github.com/nab138/isideload"
documentation = "https://docs.rs/isideload"

View File

@@ -8,6 +8,7 @@ use plist_macro::plist;
use reqwest::header::{CONTENT_TYPE, HeaderMap, HeaderValue};
use rootcause::prelude::*;
use serde::Deserialize;
use tokio::time::{Duration, timeout};
use tokio_tungstenite::tungstenite::Message;
use tracing::{debug, info, warn};
@@ -238,7 +239,13 @@ impl RemoteV3AnisetteProvider {
.replace("http://", "ws://");
debug!("Starting provisioning at {}", websocket_url);
let (mut ws_stream, _) = tokio_tungstenite::connect_async(&websocket_url).await?;
let (mut ws_stream, _) = timeout(
Duration::from_secs(10),
tokio_tungstenite::connect_async(&websocket_url),
)
.await
.context("Failed to connect to provisioning socket")?
.context("Failed to connect to provisioning socket")?;
debug!("Connected to provisioning socket");