mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-16 21:16:35 +00:00
This reverts commit da57fcb641.
This commit is contained in:
@@ -4,7 +4,7 @@ use hbb_common::{
|
||||
allow_err,
|
||||
bytes::Bytes,
|
||||
config::{
|
||||
self, Config, LocalConfig, PeerConfig, CONNECT_TIMEOUT, RENDEZVOUS_PORT,
|
||||
self, Config, LocalConfig, PeerConfig, CONNECT_TIMEOUT, HARD_SETTINGS, RENDEZVOUS_PORT,
|
||||
},
|
||||
directories_next,
|
||||
futures::future::join_all,
|
||||
@@ -65,7 +65,6 @@ lazy_static::lazy_static! {
|
||||
id: "".to_owned(),
|
||||
}));
|
||||
static ref ASYNC_JOB_STATUS : Arc<Mutex<String>> = Default::default();
|
||||
static ref ASYNC_HTTP_STATUS : Arc<Mutex<HashMap<String, String>>> = Arc::new(Mutex::new(HashMap::new()));
|
||||
static ref TEMPORARY_PASSWD : Arc<Mutex<String>> = Arc::new(Mutex::new("".to_owned()));
|
||||
}
|
||||
|
||||
@@ -422,16 +421,6 @@ pub fn set_socks(proxy: String, username: String, password: String) {
|
||||
.ok();
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn get_proxy_status() -> bool {
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
return ipc::get_proxy_status();
|
||||
|
||||
// Currently, only the desktop version has proxy settings.
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
return false;
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "android", target_os = "ios"))]
|
||||
pub fn set_socks(_: String, _: String, _: String) {}
|
||||
|
||||
@@ -719,28 +708,6 @@ pub fn change_id(id: String) {
|
||||
});
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn http_request(url: String, method: String, body: Option<String>, header: String) {
|
||||
// Respond to concurrent requests for resources
|
||||
let current_request = ASYNC_HTTP_STATUS.clone();
|
||||
current_request.lock().unwrap().insert(url.clone()," ".to_owned());
|
||||
std::thread::spawn(move || {
|
||||
let res = match crate::http_request_sync(url.clone(), method, body, header) {
|
||||
Err(err) => { log::error!("{}", err); err.to_string() },
|
||||
Ok(text) => text,
|
||||
};
|
||||
current_request.lock().unwrap().insert(url,res);
|
||||
});
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_async_http_status(url: String) -> Option<String> {
|
||||
match ASYNC_HTTP_STATUS.lock().unwrap().get(&url) {
|
||||
None => {None}
|
||||
Some(_str) => {Some(_str.to_string())}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[inline]
|
||||
pub fn post_request(url: String, body: String, header: String) {
|
||||
*ASYNC_JOB_STATUS.lock().unwrap() = " ".to_owned();
|
||||
|
||||
Reference in New Issue
Block a user