Fix misspelled words
This commit is contained in:
parent
96208e9fef
commit
7f13edd14a
@ -75,8 +75,8 @@ message PunchHoleResponse {
|
|||||||
enum Failure {
|
enum Failure {
|
||||||
ID_NOT_EXIST = 1;
|
ID_NOT_EXIST = 1;
|
||||||
OFFLINE = 2;
|
OFFLINE = 2;
|
||||||
LICENCE_MISMATCH = 3;
|
LICENSE_MISMATCH = 3;
|
||||||
LICENCE_OVERUSE = 4;
|
LICENSE_OVERUSE = 4;
|
||||||
}
|
}
|
||||||
Failure failure = 3;
|
Failure failure = 3;
|
||||||
string relay_server = 4;
|
string relay_server = 4;
|
||||||
|
@ -193,7 +193,7 @@ pub struct TransferJob {
|
|||||||
file: Option<File>,
|
file: Option<File>,
|
||||||
total_size: u64,
|
total_size: u64,
|
||||||
finished_size: u64,
|
finished_size: u64,
|
||||||
transfered: u64,
|
transferred: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -268,8 +268,8 @@ impl TransferJob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn transfered(&self) -> u64 {
|
pub fn transferred(&self) -> u64 {
|
||||||
self.transfered
|
self.transferred
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
@ -332,7 +332,7 @@ impl TransferJob {
|
|||||||
self.file.as_mut().unwrap().write_all(&block.data).await?;
|
self.file.as_mut().unwrap().write_all(&block.data).await?;
|
||||||
self.finished_size += block.data.len() as u64;
|
self.finished_size += block.data.len() as u64;
|
||||||
}
|
}
|
||||||
self.transfered += block.data.len() as u64;
|
self.transferred += block.data.len() as u64;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ impl TransferJob {
|
|||||||
compressed = true;
|
compressed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.transfered += buf.len() as u64;
|
self.transferred += buf.len() as u64;
|
||||||
}
|
}
|
||||||
Ok(Some(FileTransferBlock {
|
Ok(Some(FileTransferBlock {
|
||||||
id: self.id,
|
id: self.id,
|
||||||
|
@ -34,7 +34,7 @@ fn new_socket(addr: std::net::SocketAddr, reuse: bool) -> Result<TcpSocket, std:
|
|||||||
if reuse {
|
if reuse {
|
||||||
// windows has no reuse_port, but it's reuse_address
|
// windows has no reuse_port, but it's reuse_address
|
||||||
// almost equals to unix's reuse_port + reuse_address,
|
// almost equals to unix's reuse_port + reuse_address,
|
||||||
// though may introduce nondeterministic bahavior
|
// though may introduce nondeterministic behavior
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
socket.set_reuseport(true)?;
|
socket.set_reuseport(true)?;
|
||||||
socket.set_reuseaddr(true)?;
|
socket.set_reuseaddr(true)?;
|
||||||
|
@ -29,7 +29,7 @@ fn new_socket(addr: SocketAddr, reuse: bool) -> Result<Socket, std::io::Error> {
|
|||||||
if reuse {
|
if reuse {
|
||||||
// windows has no reuse_port, but it's reuse_address
|
// windows has no reuse_port, but it's reuse_address
|
||||||
// almost equals to unix's reuse_port + reuse_address,
|
// almost equals to unix's reuse_port + reuse_address,
|
||||||
// though may introduce nondeterministic bahavior
|
// though may introduce nondeterministic behavior
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
socket.set_reuse_port(true)?;
|
socket.set_reuse_port(true)?;
|
||||||
socket.set_reuse_address(true)?;
|
socket.set_reuse_address(true)?;
|
||||||
|
@ -141,7 +141,7 @@ impl Client {
|
|||||||
punch_hole_response::Failure::OFFLINE => {
|
punch_hole_response::Failure::OFFLINE => {
|
||||||
bail!("Remote desktop is offline");
|
bail!("Remote desktop is offline");
|
||||||
}
|
}
|
||||||
punch_hole_response::Failure::LICENCE_MISMATCH => {
|
punch_hole_response::Failure::LICENSE_MISMATCH => {
|
||||||
bail!("Key mismatch");
|
bail!("Key mismatch");
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
@ -147,7 +147,7 @@ pub async fn new_listener(postfix: &str) -> ResultType<Incoming> {
|
|||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
log::error!(
|
log::error!(
|
||||||
"Faild to start ipc{} server at path {}: {}",
|
"Failed to start ipc{} server at path {}: {}",
|
||||||
postfix,
|
postfix,
|
||||||
path,
|
path,
|
||||||
err
|
err
|
||||||
@ -374,7 +374,7 @@ pub fn set_password(v: String) -> ResultType<()> {
|
|||||||
|
|
||||||
pub fn get_id() -> String {
|
pub fn get_id() -> String {
|
||||||
if let Ok(Some(v)) = get_config("id") {
|
if let Ok(Some(v)) = get_config("id") {
|
||||||
// update salt also, so that nexttime reinstallation not causing first-time auto-login failure
|
// update salt also, so that next time reinstallation not causing first-time auto-login failure
|
||||||
if let Ok(Some(v2)) = get_config("salt") {
|
if let Ok(Some(v2)) = get_config("salt") {
|
||||||
Config::set_salt(&v2);
|
Config::set_salt(&v2);
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ pub struct RendezvousMediator {
|
|||||||
host: String,
|
host: String,
|
||||||
host_prefix: String,
|
host_prefix: String,
|
||||||
rendezvous_servers: Vec<String>,
|
rendezvous_servers: Vec<String>,
|
||||||
last_id_pk_registery: String,
|
last_id_pk_registry: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RendezvousMediator {
|
impl RendezvousMediator {
|
||||||
@ -90,7 +90,7 @@ impl RendezvousMediator {
|
|||||||
host: host.clone(),
|
host: host.clone(),
|
||||||
host_prefix,
|
host_prefix,
|
||||||
rendezvous_servers,
|
rendezvous_servers,
|
||||||
last_id_pk_registery: "".to_owned(),
|
last_id_pk_registry: "".to_owned(),
|
||||||
};
|
};
|
||||||
allow_err!(rz.dns_check());
|
allow_err!(rz.dns_check());
|
||||||
let mut socket = FramedSocket::new(Config::get_any_listen_addr()).await?;
|
let mut socket = FramedSocket::new(Config::get_any_listen_addr()).await?;
|
||||||
@ -377,7 +377,7 @@ impl RendezvousMediator {
|
|||||||
pk.clone()
|
pk.clone()
|
||||||
};
|
};
|
||||||
let id = Config::get_id();
|
let id = Config::get_id();
|
||||||
self.last_id_pk_registery = id.clone();
|
self.last_id_pk_registry = id.clone();
|
||||||
msg_out.set_register_pk(RegisterPk {
|
msg_out.set_register_pk(RegisterPk {
|
||||||
id,
|
id,
|
||||||
uuid,
|
uuid,
|
||||||
@ -389,7 +389,7 @@ impl RendezvousMediator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_uuid_mismatch(&mut self, socket: &mut FramedSocket) -> ResultType<()> {
|
async fn handle_uuid_mismatch(&mut self, socket: &mut FramedSocket) -> ResultType<()> {
|
||||||
if self.last_id_pk_registery != Config::get_id() {
|
if self.last_id_pk_registry != Config::get_id() {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -621,7 +621,7 @@ pub fn check_zombie(childs: Childs) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// notice: avoiding create ipc connecton repeatly,
|
// notice: avoiding create ipc connection repeatedly,
|
||||||
// because windows named pipe has serious memory leak issue.
|
// because windows named pipe has serious memory leak issue.
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn check_connect_status_(
|
async fn check_connect_status_(
|
||||||
|
@ -694,8 +694,8 @@ impl Handler {
|
|||||||
let mut key_event = KeyEvent::new();
|
let mut key_event = KeyEvent::new();
|
||||||
if down_or_up == 2 {
|
if down_or_up == 2 {
|
||||||
/* windows send both keyup/keydown and keychar, so here we avoid keychar
|
/* windows send both keyup/keydown and keychar, so here we avoid keychar
|
||||||
for <= 0xFF, best practise should only avoid those not on keyboard, but
|
for <= 0xFF, best practice should only avoid those not on keyboard, but
|
||||||
for now, we have no way to test, so avoid <= 0xFF totaly
|
for now, we have no way to test, so avoid <= 0xFF totally
|
||||||
*/
|
*/
|
||||||
if code <= 0xFF {
|
if code <= 0xFF {
|
||||||
return None;
|
return None;
|
||||||
@ -891,7 +891,8 @@ impl Handler {
|
|||||||
|
|
||||||
let mut name = name;
|
let mut name = name;
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
if code == 65383 { // VK_MENU
|
if code == 65383 {
|
||||||
|
// VK_MENU
|
||||||
name = "Apps".to_owned();
|
name = "Apps".to_owned();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1435,16 +1436,16 @@ impl Remote {
|
|||||||
if elapsed <= 0 {
|
if elapsed <= 0 {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let transfered = job.transfered();
|
let transferred = job.transferred();
|
||||||
let last_transfered = {
|
let last_transferred = {
|
||||||
if let Some(v) = last_update_jobs_status.1.get(&job.id()) {
|
if let Some(v) = last_update_jobs_status.1.get(&job.id()) {
|
||||||
v.to_owned()
|
v.to_owned()
|
||||||
} else {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
last_update_jobs_status.1.insert(job.id(), transfered);
|
last_update_jobs_status.1.insert(job.id(), transferred);
|
||||||
let speed = (transfered - last_transfered) as f64 / (elapsed as f64 / 1000.);
|
let speed = (transferred - last_transferred) as f64 / (elapsed as f64 / 1000.);
|
||||||
let file_num = job.file_num() - 1;
|
let file_num = job.file_num() - 1;
|
||||||
handler.call(
|
handler.call(
|
||||||
"jobProgress",
|
"jobProgress",
|
||||||
|
@ -89,7 +89,7 @@ extern "C"
|
|||||||
|
|
||||||
CreateEnvironmentBlock(&lpEnvironment, // Environment block
|
CreateEnvironmentBlock(&lpEnvironment, // Environment block
|
||||||
hToken, // New token
|
hToken, // New token
|
||||||
TRUE); // Inheritence
|
TRUE); // Inheritance
|
||||||
}
|
}
|
||||||
if (lpEnvironment)
|
if (lpEnvironment)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user