udp / ipv6 punch option

This commit is contained in:
rustdesk
2025-06-14 21:42:18 +08:00
parent bf77f582d0
commit 645a76d43f
55 changed files with 269 additions and 30 deletions

View File

@@ -0,0 +1,56 @@
You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code.
Follow these steps carefully:
1. Analysis Phase:
Review the chat history in your context window.
Then, examine the current Claude instructions, commands and config
<claude_instructions>
/CLAUDE.md
/.claude/commands/*
**/CLAUDE.md
.claude/settings.json
.claude/settings.local.json
</claude_instructions>
Analyze the chat history, instructions, commands and config to identify areas that could be improved. Look for:
- Inconsistencies in Claude's responses
- Misunderstandings of user requests
- Areas where Claude could provide more detailed or accurate information
- Opportunities to enhance Claude's ability to handle specific types of queries or tasks
- New commands or improvements to a commands name, function or response
- Permissions and MCPs we've approved locally that we should add to the config, especially if we've added new tools or require them for the command to work
2. Interaction Phase:
Present your findings and improvement ideas to the human. For each suggestion:
a) Explain the current issue you've identified
b) Propose a specific change or addition to the instructions
c) Describe how this change would improve Claude's performance
Wait for feedback from the human on each suggestion before proceeding. If the human approves a change, move it to the implementation phase. If not, refine your suggestion or move on to the next idea.
3. Implementation Phase:
For each approved change:
a) Clearly state the section of the instructions you're modifying
b) Present the new or modified text for that section
c) Explain how this change addresses the issue identified in the analysis phase
4. Output Format:
Present your final output in the following structure:
<analysis>
[List the issues identified and potential improvements]
</analysis>
<improvements>
[For each approved improvement:
1. Section being modified
2. New or modified instruction text
3. Explanation of how this addresses the identified issue]
</improvements>
<final_instructions>
[Present the complete, updated set of instructions for Claude, incorporating all approved changes]
</final_instructions>
Remember, your goal is to enhance Claude's performance and consistency while maintaining the core functionality and purpose of the AI assistant. Be thorough in your analysis, clear in your explanations, and precise in your implementations.

View File

@@ -82,3 +82,10 @@ When working with files, ignore these directories:
- `flutter` - Enable Flutter UI
- `unix-file-copy-paste` - Unix file clipboard support
- `screencapturekit` - macOS ScreenCaptureKit (macOS only)
### Config
All configurations or options are under `libs/hbb_common/src/config.rs` file, 4 types:
- Settings
- Local
- Display
- Built-in

View File

@@ -147,6 +147,8 @@ const String kOptionAllowRemoveWallpaper = "allow-remove-wallpaper";
const String kOptionStopService = "stop-service";
const String kOptionDirectxCapture = "enable-directx-capture";
const String kOptionAllowRemoteCmModification = "allow-remote-cm-modification";
const String kOptionEnableUdpPunch = "enable-udp-punch";
const String kOptionEnableIpv6Punch = "enable-ipv6-punch";
const String kOptionEnableTrustedDevices = "enable-trusted-devices";
// network options

View File

@@ -540,6 +540,20 @@ class _GeneralState extends State<_General> {
'Capture screen using DirectX',
kOptionDirectxCapture,
),
if (!bind.isIncomingOnly()) ...[
_OptionCheckBox(
context,
'Enable UDP hole punching',
kOptionEnableUdpPunch,
isServer: false,
),
_OptionCheckBox(
context,
'Enable IPv6 P2P connection',
kOptionEnableIpv6Punch,
isServer: false,
),
],
],
];
if (!isWeb && bind.mainShowOption(key: kOptionAllowLinuxHeadless)) {

View File

@@ -5,7 +5,6 @@ import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/common/widgets/setting_widgets.dart';
import 'package:flutter_hbb/desktop/pages/desktop_setting_page.dart';
import 'package:flutter_hbb/models/state_model.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:settings_ui/settings_ui.dart';
@@ -94,6 +93,8 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
var _hideNetwork = false;
var _hideWebSocket = false;
var _enableTrustedDevices = false;
var _enableUdpPunch = false;
var _enableIpv6Punch = false;
_SettingsState() {
_enableAbr = option2bool(
@@ -124,8 +125,11 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
_hideNetwork =
bind.mainGetBuildinOption(key: kOptionHideNetworkSetting) == 'Y';
_hideWebSocket =
bind.mainGetBuildinOption(key: kOptionHideWebSocketSetting) == 'Y' || isWeb;
bind.mainGetBuildinOption(key: kOptionHideWebSocketSetting) == 'Y' ||
isWeb;
_enableTrustedDevices = mainGetBoolOptionSync(kOptionEnableTrustedDevices);
_enableUdpPunch = mainGetLocalBoolOptionSync(kOptionEnableUdpPunch);
_enableIpv6Punch = mainGetLocalBoolOptionSync(kOptionEnableIpv6Punch);
}
@override
@@ -687,6 +691,32 @@ class _SettingsState extends State<SettingsPage> with WidgetsBindingObserver {
});
},
),
if (!incomingOnly)
SettingsTile.switchTile(
title: Text(translate('Enable UDP hole punching')),
initialValue: _enableUdpPunch,
onToggle: (v) async {
await mainSetLocalBoolOption(kOptionEnableUdpPunch, v);
final newValue =
mainGetLocalBoolOptionSync(kOptionEnableUdpPunch);
setState(() {
_enableUdpPunch = newValue;
});
},
),
if (!incomingOnly)
SettingsTile.switchTile(
title: Text(translate('Enable IPv6 P2P connection')),
initialValue: _enableIpv6Punch,
onToggle: (v) async {
await mainSetLocalBoolOption(kOptionEnableIpv6Punch, v);
final newValue =
mainGetLocalBoolOptionSync(kOptionEnableIpv6Punch);
setState(() {
_enableIpv6Punch = newValue;
});
},
),
SettingsTile(
title: Text(translate('Language')),
leading: Icon(Icons.translate),

View File

@@ -274,21 +274,28 @@ impl Client {
}
};
crate::test_ipv6().await;
if crate::get_ipv6_punch_enabled() {
crate::test_ipv6().await;
}
let (stop_udp_tx, stop_udp_rx) = oneshot::channel::<()>();
let mut udp =
// no need to care about multiple rendezvous servers case, since it is acutally not used any more.
// Shared state for UDP NAT test result
if let Ok((socket, addr)) = new_direct_udp_for(&rendezvous_server).await {
let udp_port = Arc::new(Mutex::new(0));
let up_cloned = udp_port.clone();
let socket_cloned = socket.clone();
let func = async move {
allow_err!(test_udp_uat(socket_cloned, addr, up_cloned, stop_udp_rx).await);
};
tokio::spawn(func);
(Some(socket), Some(udp_port))
if crate::get_udp_punch_enabled() {
if let Ok((socket, addr)) = new_direct_udp_for(&rendezvous_server).await {
let udp_port = Arc::new(Mutex::new(0));
let up_cloned = udp_port.clone();
let socket_cloned = socket.clone();
let func = async move {
allow_err!(test_udp_uat(socket_cloned, addr, up_cloned, stop_udp_rx).await);
};
tokio::spawn(func);
(Some(socket), Some(udp_port))
} else {
(None, None)
}
} else {
(None, None)
};
@@ -351,8 +358,12 @@ impl Client {
// Stop UDP NAT test task if still running
let _ = stop_udp_tx.send(());
let mut msg_out = RendezvousMessage::new();
let mut ipv6 = if let Some((socket, addr)) = crate::get_ipv6_socket().await {
(Some(socket), Some(addr))
let mut ipv6 = if crate::get_ipv6_punch_enabled() {
if let Some((socket, addr)) = crate::get_ipv6_socket().await {
(Some(socket), Some(addr))
} else {
(None, None)
}
} else {
(None, None)
};
@@ -3778,7 +3789,7 @@ pub mod peer_online {
}
// Retry for 2 times to get the online response
for _ in 0..2 {
if let Some(msg_in) = crate::common::get_next_nonkeyexchange_msg(
if let Some(msg_in) = crate::get_next_nonkeyexchange_msg(
&mut socket,
Some(timeout.as_millis() as _),
)

View File

@@ -6,7 +6,6 @@ use std::{
task::Poll,
};
use default_net::ip;
use serde_json::{json, Map, Value};
#[cfg(not(any(target_os = "android", target_os = "ios")))]
@@ -16,7 +15,9 @@ use hbb_common::{
anyhow::{anyhow, Context},
bail, base64,
bytes::Bytes,
config::{self, use_ws, Config, CONNECT_TIMEOUT, READ_TIMEOUT, RENDEZVOUS_PORT},
config::{
self, keys, use_ws, Config, LocalConfig, CONNECT_TIMEOUT, READ_TIMEOUT, RENDEZVOUS_PORT,
},
futures::future::join_all,
futures_util::future::poll_fn,
get_version_number, log,
@@ -881,8 +882,8 @@ pub fn check_software_update() {
if is_custom_client() {
return;
}
let opt = config::LocalConfig::get_option(config::keys::OPTION_ENABLE_CHECK_UPDATE);
if config::option2bool(config::keys::OPTION_ENABLE_CHECK_UPDATE, &opt) {
let opt = LocalConfig::get_option(keys::OPTION_ENABLE_CHECK_UPDATE);
if config::option2bool(keys::OPTION_ENABLE_CHECK_UPDATE, &opt) {
std::thread::spawn(move || allow_err!(do_check_software_update()));
}
}
@@ -973,7 +974,7 @@ pub fn get_api_server(api: String, custom: String) -> String {
}
if res.starts_with("https")
&& res.ends_with(":21114")
&& get_builtin_option(config::keys::OPTION_ALLOW_HTTPS_21114) != "Y"
&& get_builtin_option(keys::OPTION_ALLOW_HTTPS_21114) != "Y"
{
return res.replace(":21114", "");
}
@@ -1011,6 +1012,32 @@ pub fn is_public(url: &str) -> bool {
url.contains("rustdesk.com")
}
pub fn get_udp_punch_enabled() -> bool {
config::option2bool(
keys::OPTION_ENABLE_UDP_PUNCH,
&get_local_option(keys::OPTION_ENABLE_UDP_PUNCH),
)
}
pub fn get_ipv6_punch_enabled() -> bool {
config::option2bool(
keys::OPTION_ENABLE_IPV6_PUNCH,
&get_local_option(keys::OPTION_ENABLE_IPV6_PUNCH),
)
}
pub fn get_local_option(key: &str) -> String {
let v = LocalConfig::get_option(key);
if key == keys::OPTION_ENABLE_UDP_PUNCH || key == keys::OPTION_ENABLE_IPV6_PUNCH {
if v.is_empty() {
if !is_public(&Config::get_rendezvous_server()) {
return "N".to_owned();
}
}
}
v
}
pub fn get_audit_server(api: String, custom: String, typ: String) -> String {
let url = get_api_server(api, custom);
if url.is_empty() || is_public(&url) {
@@ -1618,19 +1645,19 @@ pub fn read_custom_client(config: &str) {
}
let mut map_display_settings = HashMap::new();
for s in config::keys::KEYS_DISPLAY_SETTINGS {
for s in keys::KEYS_DISPLAY_SETTINGS {
map_display_settings.insert(s.replace("_", "-"), s);
}
let mut map_local_settings = HashMap::new();
for s in config::keys::KEYS_LOCAL_SETTINGS {
for s in keys::KEYS_LOCAL_SETTINGS {
map_local_settings.insert(s.replace("_", "-"), s);
}
let mut map_settings = HashMap::new();
for s in config::keys::KEYS_SETTINGS {
for s in keys::KEYS_SETTINGS {
map_settings.insert(s.replace("_", "-"), s);
}
let mut buildin_settings = HashMap::new();
for s in config::keys::KEYS_BUILDIN_SETTINGS {
for s in keys::KEYS_BUILDIN_SETTINGS {
buildin_settings.insert(s.replace("_", "-"), s);
}
if let Some(default_settings) = data.remove("default-settings") {
@@ -1725,7 +1752,7 @@ pub fn verify_login(raw: &str, id: &str) -> bool {
#[inline]
pub fn is_udp_disabled() -> bool {
get_builtin_option(config::keys::OPTION_DISABLE_UDP) == "Y"
get_builtin_option(keys::OPTION_DISABLE_UDP) == "Y"
}
// this crate https://github.com/yoshd/stun-client supports nat type

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "سرعة لوحة التتبع"),
("Default trackpad speed", "سرعة لوحة التتبع الافتراضية"),
("Numeric one-time password", "كلمة مرور رقمية لمرة واحدة"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "触控板速度"),
("Default trackpad speed", "默认触控板速度"),
("Numeric one-time password", "一次性密码为数字"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Geschwindigkeit des Trackpads"),
("Default trackpad speed", "Standardgeschwindigkeit des Trackpads"),
("Numeric one-time password", "Numerisches Einmalpasswort"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Velocidad de trackpad"),
("Default trackpad speed", "Velocidad predeterminada de trackpad"),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "سرعت ترک‌پد"),
("Default trackpad speed", "سرعت پیش‌فرض ترک‌پد"),
("Numeric one-time password", "رمز عبور یک‌بار مصرف عددی"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Vitesse du pavé tactile"),
("Default trackpad speed", "Vitesse par défaut du pavé tactile"),
("Numeric one-time password", "Mot de passe à usage unique numérique"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "מהירות משטח מגע"),
("Default trackpad speed", "מהירות ברירת מחדל של משטח מגע"),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Érintőpad sebessége"),
("Default trackpad speed", "Alapértelmezett érintőpad sebessége"),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Velocità trackpad"),
("Default trackpad speed", "Velocità predefinita trackpad"),
("Numeric one-time password", "Password numerica monouso"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -690,7 +690,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable remote printer", "원격 프린터 활성화"),
("Downloading {}", "{} 다운로드 중"),
("{} Update", "{} 업데이트"),
("update_to_{}_tip", "{} 버전으로 업데이트합니다. 프로그램 종료 후 새 버전이 설치됩니다."),
("{}-to-update-tip", ""),
("download-new-version-failed-tip", "다운로드에 실패했습니다. 다시 시도하거나 '다운로드' 버튼을 클릭하여 릴리스 페이지에서 직접 다운로드한 후 수동으로 업그레이드하십시오."),
("Auto update", "자동 업데이트"),
("update-failed-check-msi-tip", "설치 방법을 확인할 수 없습니다. '다운로드' 버튼을 클릭하여 릴리스 페이지에서 직접 다운로드한 후 수동으로 업그레이드하십시오."),
@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "트랙패드 속도"),
("Default trackpad speed", "기본 트랙패드 속도"),
("Numeric one-time password", "일회용 비밀번호"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Skārienpaliktņa ātrums"),
("Default trackpad speed", "Noklusējuma skārienpaliktņa ātrums"),
("Numeric one-time password", "Vienreiz lietojama ciparu parole"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Snelheid Trackpad"),
("Default trackpad speed", "Standaardsnelheid Trackpad"),
("Numeric one-time password", "Eenmalig numeriek wachtwoord"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "Скорость трекпада"),
("Default trackpad speed", "Скорость трекпада по умолчанию"),
("Numeric one-time password", "Цифровой одноразовый пароль"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", "觸控板速度"),
("Default trackpad speed", "預設觸控板速度"),
("Numeric one-time password", "數字一次性密碼"),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -699,5 +699,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Trackpad speed", ""),
("Default trackpad speed", ""),
("Numeric one-time password", ""),
("Enable IPv6 P2P connection", ""),
("Enable UDP hole punching", ""),
].iter().cloned().collect();
}

View File

@@ -4,7 +4,7 @@ use hbb_common::{
allow_err,
bytes::Bytes,
config::{
self, keys::*, option2bool, Config, LocalConfig, PeerConfig, CONNECT_TIMEOUT,
self, keys::*, Config, LocalConfig, PeerConfig, CONNECT_TIMEOUT,
RENDEZVOUS_PORT,
},
directories_next,
@@ -208,7 +208,7 @@ pub fn use_texture_render() -> bool {
#[inline]
pub fn get_local_option(key: String) -> String {
LocalConfig::get_option(&key)
crate::get_local_option(&key)
}
#[inline]
@@ -1185,7 +1185,7 @@ async fn check_connect_status_(reconnect: bool, rx: mpsc::UnboundedReceiver<ipc:
{
let b = OPTIONS.lock().unwrap().get(OPTION_ENABLE_FILE_TRANSFER).map(|x| x.to_string()).unwrap_or_default();
if b != enable_file_transfer {
clipboard::ContextSend::enable(option2bool(OPTION_ENABLE_FILE_TRANSFER, &b));
clipboard::ContextSend::enable(config::option2bool(OPTION_ENABLE_FILE_TRANSFER, &b));
enable_file_transfer = b;
}
}