mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-20 14:52:22 +02:00
fix: retry unstarted streams on an available provider alias (#885)
* **Bug Fixes** * Playback retries can use another available provider when playback has not started, helping requests proceed if the initially selected provider is unavailable. * Once playback has started, retries continue using the same eligible provider to preserve playback continuity. * Provider selection follows the same rules for regular playback and forced reopens, reducing unnecessary provider pinning before media begins. * Series episode URLs can resolve to the correct account-specific playback address.
This commit is contained in:
@@ -1095,6 +1095,7 @@ async fn forced_legacy_hls_test_response(
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: origin_url.as_str().intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -1243,6 +1244,7 @@ async fn forced_reopen_stays_on_pinned_provider_account() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_a}/live/1.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -1322,6 +1324,7 @@ async fn overlapping_vod_range_requests_return_correct_account_bytes() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/movie/1.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -1440,6 +1443,7 @@ async fn parallel_series_range_requests_keep_both_claims_active() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/series/1.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -1790,6 +1794,7 @@ fn load_test_session(input: &ConfigInput, origin_addr: SocketAddr, token: &str,
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/live/42.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
user_agent_stream_index: None,
|
||||
addr,
|
||||
socket_bound: false,
|
||||
@@ -2075,6 +2080,7 @@ async fn direct_ts_eof_before_first_byte_releases_slot_without_idle_lease() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/live/42.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -2164,6 +2170,7 @@ async fn direct_ts_abort_while_waiting_for_first_byte_releases_exact_request() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/live/42.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -2529,6 +2536,7 @@ async fn parallel_vod_abort_preserves_sibling_claim_and_provider_stickiness() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/movie/1.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -2688,6 +2696,7 @@ async fn parallel_series_abort_then_seek_reuses_account_without_stale_claim() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_addr}/series/1.ts").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -3305,6 +3314,7 @@ async fn catchup_abort_seek_and_window_change_preserve_correct_affinity() {
|
||||
provider: Arc::clone(&input.name),
|
||||
stream_url: format!("http://{origin_a}/timeshift/1.ts?window={window}").intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(true)),
|
||||
user_agent_stream_index: None,
|
||||
addr: client_addr,
|
||||
socket_bound: false,
|
||||
@@ -4397,6 +4407,7 @@ fn test_should_allow_exhausted_shared_reconnect_only_for_matching_shared_session
|
||||
provider: Arc::<str>::from("provider"),
|
||||
stream_url: Arc::<str>::from("http://provider/live/449924.ts"),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
user_agent_stream_index: None,
|
||||
addr: "127.0.0.1:1234".parse().unwrap_or_else(|_| unreachable!()),
|
||||
socket_bound: false,
|
||||
@@ -5180,6 +5191,7 @@ fn create_test_session(
|
||||
_ => "http://provider-1.example/live/42.ts",
|
||||
}),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
user_agent_stream_index: None,
|
||||
addr: "127.0.0.1:55555".parse().unwrap_or_else(|_| unreachable!()),
|
||||
socket_bound: item_type.uses_socket_bound_session(),
|
||||
@@ -9130,6 +9142,7 @@ fn session_reacquire_cleanup_addrs_excludes_current_and_deduplicates() {
|
||||
provider: "provider-a".intern(),
|
||||
stream_url: "http://localhost/movie.mkv".intern(),
|
||||
provider_session_headers: HashMap::new(),
|
||||
media_started: Arc::new(std::sync::atomic::AtomicBool::new(false)),
|
||||
user_agent_stream_index: None,
|
||||
addr: seek,
|
||||
socket_bound: false,
|
||||
|
||||
Reference in New Issue
Block a user