mirror of
https://github.com/therealaleph/MasterHttpRelayVPN-RUST.git
synced 2026-05-18 05:36:56 +03:00
fix(tunnel-client): use portable_atomic::AtomicU64 for 32-bit MIPS
PR #153's connect_data instrumentation imported `AtomicU64` directly from `std::sync::atomic`, which works on every release target except the 32-bit MIPS OpenWRT target (`mipsel-unknown-linux-musl`) — that platform has no hardware-backed 64-bit atomics, and Rust's std type isn't even defined there. The v1.4.0 release workflow's mipsel build failed with `error[E0432]: no AtomicU64 in sync::atomic`. `domain_fronter.rs` already imports `portable_atomic::AtomicU64` for the same reason — `portable-atomic` (already in Cargo.toml with the "fallback" feature) provides a software-emulated 64-bit atomic on targets that need it. Apply the same import here for the new preread_* counter and connect_data_unsupported flag. `AtomicBool` stays in std — it works on every target, no polyfill needed. Verified locally: cargo build + cargo test --lib (91/91 pass) clean with the import change. Same v1.4.0 — no version bump. Re-runs the release workflow to publish the missing mhrv-rs-openwrt-mipsel-softfloat artifact alongside the existing v1.4.0 release assets. Telegram notification suppressed for this re-publish (same version, no point re-posting). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,14 @@
|
||||
//! 30 in-flight requests — matching the per-account Apps Script limit.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
|
||||
// `AtomicU64` from `std::sync::atomic` requires hardware-backed 64-bit
|
||||
// atomics, which 32-bit MIPS (`mipsel-unknown-linux-musl` — our OpenWRT
|
||||
// router target) does not provide — the std type isn't even defined
|
||||
// there, so the build fails with `no AtomicU64 in sync::atomic`. We
|
||||
// already pull `portable-atomic` for `domain_fronter.rs` for the same
|
||||
// reason; reuse it here. `AtomicBool` works fine in std on every target.
|
||||
use portable_atomic::AtomicU64;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user