Skip to content

Commit 23991a9

Browse files
therealalephclaude
andcommitted
fix: v1.9.14 — block_doh default upgrade-path regression (#773)
PR #763 added `block_doh: bool` with `#[serde(default)]`, which resolves to Rust's `Default::default() = false` for bool, not the `true` PR #763's docs intended. Existing configs upgrading from v1.9.10 → v1.9.13 had no block_doh field, so they got `false` paired with `tunnel_doh: true` (new default from #468) — every browser DoH lookup got tunneled through Apps Script, adding ~1.5s overhead per page load. User-perceived as "v1.9.13 is slower than v1.9.10" in #773. Switched to a named-default function `default_block_doh() -> bool { true }` so the upgrade path actually delivers the fast block-then-system-DNS behaviour PR #763 advertised. Power users who specifically want browser DoH (with the latency cost) can still opt in with explicit `block_doh: false`. Tests: 180 lib + 35 tunnel-node + UI release-mode build all green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 607d23c commit 23991a9

4 files changed

Lines changed: 27 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mhrv-rs"
3-
version = "1.9.13"
3+
version = "1.9.14"
44
edition = "2021"
55
description = "Rust port of MasterHttpRelayVPN -- DPI bypass via Google Apps Script relay with domain fronting"
66
license = "MIT"

docs/changelog/v1.9.14.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- see docs/changelog/v1.1.0.md for the file format: Persian, then `---`, then English. -->
2+
• Fix v1.9.13 regression — کاربران v1.9.10 → v1.9.13 upgrade می‌کردن و حس می‌کردن کندتره ([#773](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/773)). علت: `block_doh` در Rust با `#[serde(default)]` برای فیلد `bool` به `false` resolve می‌شد (default trait از Rust)، نه `true` که PR [#763](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/pull/763) قصد داشت. کاربران existing با config.json بدون فیلد `block_doh` و `tunnel_doh = true` (default جدید از #468)، هر DNS lookup رو از مسیر Apps Script می‌فرستادن — ~۱.۵ ثانیه overhead هر page load. حالا `block_doh` با named-default function به `true` resolve می‌شه — مرورگر DoH reject می‌شه + system DNS via tun2proxy فوراً پاسخ می‌ده + هیچ tunnel round-trip دیگه. کاربران power که عمداً DoH از تونل می‌خوان، می‌تونن `block_doh: false` صریح بگذارن. تست: 180 lib + 35 tunnel-node + UI release-mode build همه green.
3+
---
4+
• Fix v1.9.13 perceived-slowness regression on upgrade ([#773](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/issues/773)): `block_doh` was using `#[serde(default)]` on a `bool`, which resolves to Rust's `Default::default() = false` rather than the `true` PR [#763](https://github.com/therealaleph/MasterHttpRelayVPN-RUST/pull/763) intended. Existing configs upgrading from v1.9.10 had no `block_doh` field, so they got `false` paired with `tunnel_doh = true` (the new default from #468) — every browser DoH lookup got tunneled through Apps Script, adding ~1.5s overhead per page load. Now `block_doh` uses a named-default function that returns `true` — DoH is rejected at the SOCKS5 listener so the browser falls back to system DNS (instant, via tun2proxy's virtual DNS) and no tunnel round-trip happens. Power users who specifically want DoH-through-tunnel can opt back in with `block_doh: false`. Tests: 180 lib + 35 tunnel-node + UI release-mode build all green.

src/config.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,15 @@ pub struct Config {
282282
/// lookup, which made every page load noticeably slower. Blocking
283283
/// DoH entirely avoids both problems: no ISP-visible DoH connection,
284284
/// no tunnel round-trip — browsers use the system DNS path instead.
285-
#[serde(default)]
285+
///
286+
/// Default `true` (NOT `bool::default() = false`). Critical for
287+
/// upgrading users — see #773: with the v1.9.13 default-derive bug,
288+
/// existing configs got `block_doh = false` paired with `tunnel_doh
289+
/// = true` (the new tunnel-DoH default from #468), routing every
290+
/// browser DNS lookup through Apps Script and adding ~1.5s per page
291+
/// load. The named-default function fixes the upgrade path so the
292+
/// fast block-then-system-DNS behaviour is what users actually get.
293+
#[serde(default = "default_block_doh")]
286294
pub block_doh: bool,
287295

288296
/// Multi-edge domain-fronting groups. Each group is a triple of
@@ -473,6 +481,18 @@ fn default_google_ip_validation() -> bool {true}
473481
/// opt back in with `tunnel_doh: false`.
474482
fn default_tunnel_doh() -> bool { true }
475483

484+
/// Default for `block_doh`: `true` (browser DoH is rejected so the
485+
/// browser falls back to system DNS, which `tun2proxy` resolves
486+
/// instantly via virtual DNS — saves the ~1.5s tunnel round-trip per
487+
/// name lookup that #468's `tunnel_doh: true` default would otherwise
488+
/// pay). #773 — without this named-default function, `#[serde(default)]`
489+
/// on `bool` resolves to `false`, and existing configs upgrading to
490+
/// v1.9.13 silently lost the block-and-fall-back behaviour, paying
491+
/// the full DoH-via-Apps-Script penalty on every page load. Power
492+
/// users who specifically want browser DoH (with the latency cost)
493+
/// can opt back in by setting `block_doh: false`.
494+
fn default_block_doh() -> bool { true }
495+
476496
/// Defaults for the auto-blacklist tuning knobs (#391, #444). These
477497
/// preserve historical behavior — `3 strikes / 30s window / 120s cooldown`.
478498
fn default_auto_blacklist_strikes() -> u32 { 3 }

0 commit comments

Comments
 (0)