Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos found by codespell #280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sanzu-broker/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct CmdCallBack {
pub on_connect: Command,
}

/// Support authentication mecanism
/// Support authentication mechanism
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(tag = "type", content = "args")]
pub enum AuthType {
Expand Down
6 changes: 3 additions & 3 deletions sanzu-broker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn auth_client(
debug!("Alt name: {:?}", subj_alt_name);

let tls_username = get_username_from_principal(&subj_alt_name, allowed_client_domains)
.context("Principal doesnt match realm pattern")?;
.context("Principal doesn't match realm pattern")?;
info!("TLS authentication ok for user: {}", tls_username);
username = Some(tls_username);
};
Expand Down Expand Up @@ -223,7 +223,7 @@ fn loop_fwd_conn(
.context("Error in client read")?;
trace!("forward to server {:?}", size);
if size == 0 {
debug!("Client closed connexion");
debug!("Client closed connection");
stop = true;
break;
}
Expand All @@ -237,7 +237,7 @@ fn loop_fwd_conn(
.context("Error in server read")?;
trace!("forward to client {:?}", size);
if size == 0 {
debug!("Server closed connexion");
debug!("Server closed connection");
stop = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion sanzu-common/src/auth_kerberos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn do_kerberos_client_auth(

// Check realm
let username = get_username_from_principal(&ctx_info.source_name.to_string(), allowed_realms)
.context("Principal doesnt match realm pattern")
.context("Principal doesn't match realm pattern")
.map_err(|err| send_server_err_event(sock, err))?;

debug!("Auth kerberos ok for client {:?}", username);
Expand Down
6 changes: 3 additions & 3 deletions sanzu-common/src/auth_pam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ impl pam::Conversation for &mut TunnelConversation<'_> {
Ok(out)
}
fn info(&mut self, msg: &CStr) {
let msg_string = msg.to_str().expect("Error in cstr convertion");
let msg_string = msg.to_str().expect("Error in cstr conversion");

let pam_msg = tunnel::pam_conversation::Msg::Info(msg_string.to_string());
let pam_info = tunnel::PamConversation { msg: Some(pam_msg) };
send_server_msg_type!(*self.conn.lock().unwrap(), pam_info, Pamconversation)
.expect("Error in info send");
}
fn error(&mut self, msg: &CStr) {
let msg_string = msg.to_str().expect("Eror in cstr conversion");
let msg_string = msg.to_str().expect("Error in cstr conversion");

let pam_msg = tunnel::pam_conversation::Msg::Error(msg_string.to_string());
let pam_err = tunnel::PamConversation { msg: Some(pam_msg) };
Expand Down Expand Up @@ -127,7 +127,7 @@ pub fn do_pam_auth(conn: &mut dyn ReadWrite, pam_name: &str) -> Result<String> {
match final_user {
None => Err(send_server_err_event(
*conn.lock().unwrap(),
anyhow!("Pam Authentification failed"),
anyhow!("Pam Authentication failed"),
)),
Some(username) => Ok(username),
}
Expand Down
4 changes: 2 additions & 2 deletions sanzu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If you have a server, let's say Rochefort, which runs a X server on the display
```
sanzu_client 127.0.0.1 1337 --proxycommand "ssh rochefort DISPLAY=:1234 sanzu_server --stdio"
```
In this case the connection is done throught ssh so ip and port are useless. The server must have the configuration file "/etc/sanzu.toml" present or specified with the "--config" flag.
In this case the connection is done through ssh so ip and port are useless. The server must have the configuration file "/etc/sanzu.toml" present or specified with the "--config" flag.


## Compilation
Expand Down Expand Up @@ -149,7 +149,7 @@ And the client:
sanzu_client 127.0.0.1 1144 --audio --tls-ca ./certs/rootCA.crt --tls-server-name localhost
```

## Usefull shortcuts
## Useful shortcuts
- Ctrl Alt Shift H: leave keyboard grab mode
- Ctrl Alt Shift C: on clipboard "trigger" mode, the client sends its clipboard value
- Ctrl Alt Shift S: toggle debug statistics on screen
Expand Down
2 changes: 1 addition & 1 deletion sanzu/doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The encoding / decoding process relies on FFmpeg library. Different encoders / d
The video encoder / decoder can be tweaked using a configuration file. In most cases, low latency configuration are preferred to limit lag between client and server. The configuration is described in `config.rs`. FFmpeg codec options are based on key / value tuple strings.

## Audio
The audio capture / playback is done through the `cpal` library. From a capture point of view, the process fills in a circular buffer with the sound. This buffer is drained from the main loop and compressed, then sent to the client. Note that in case of network lag, the circular buffer is constantly updated with *fresh* sound. This way, when the network unstall, the content of the fresh sound is encoded and sent to the client.
The audio capture / playback is done through the `cpal` library. From a capture point of view, the process fills in a circular buffer with the sound. This buffer is drained from the main loop and compressed, then sent to the client. Note that in case of network lag, the circular buffer is constantly updated with *fresh* sound. This way, when the network resumes, the content of the fresh sound is encoded and sent to the client.

## Keyboard
Sanzu captures raw keyboard inputs, without language layout interpretation, and apply them to the server. The result is that only the server side keyboard layout matters in the process.
Expand Down
2 changes: 1 addition & 1 deletion sanzu/src/client_wind3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ impl Client for ClientWindows {
areas_vec.sort();
if areas_vec != self.cur_areas {
debug!("Send new shape");
// /* Compute additionnal windows */
// /* Compute additional windows */
let mut areas_added = vec![];
let cur_ids = self
.cur_areas
Expand Down
4 changes: 2 additions & 2 deletions sanzu/src/client_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ pub fn init_x11rb(
(screen_width, screen_height)
};

// Force the resolution to be less thant the server side
// Force the resolution to be less than the server side
let width = width.min(screen_width);
let height = height.min(screen_height);

Expand Down Expand Up @@ -800,7 +800,7 @@ impl Client for ClientInfo {
y: event.event_y as u32,
};

/* If multiple mose moves, keep only last one */
/* If multiple mouse moves, keep only last one */
last_move = Some(tunnel::MessageClient {
msg: Some(tunnel::message_client::Msg::Move(eventmove)),
});
Expand Down
4 changes: 2 additions & 2 deletions sanzu/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct Video {
/// too little number of frames will result in a client graphic window with
/// very little details, and stall like this until the graphic change.
pub max_stall_img: u32,
/// Holds the command line to execute to retreive special ffmpeg options to
/// Holds the command line to execute to retrieve special ffmpeg options to
/// apply to the codec (which can be generated dynamically
pub ffmpeg_options_cmd: Option<String>,
/// Socket control path
Expand All @@ -58,7 +58,7 @@ pub struct ExportVideoPci {
pub device: String,
}

/// Support authentication mecanism
/// Support authentication mechanism
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(tag = "type", content = "args")]
pub enum AuthType {
Expand Down
4 changes: 2 additions & 2 deletions sanzu/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ fn auth_client(
debug!("Alt name: {:?}", subj_alt_name);

let username = get_username_from_principal(&subj_alt_name, allowed_client_domains)
.context("Principal doesnt match realm pattern")?;
.context("Principal doesn't match realm pattern")?;

Some(username)
} else {
Expand Down Expand Up @@ -586,7 +586,7 @@ pub fn run_server(config: &ConfigServer, arguments: &ServerArgsConfig) -> Result
msg_stats = msg;

prev_time_start = time_start;
loop_sleep.tick(); // sleeps to acheive target FPS rate
loop_sleep.tick(); // sleeps to achieve target FPS rate
};

Err(err)
Expand Down
6 changes: 3 additions & 3 deletions sanzu/src/server_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ pub fn init_win(
thread::spawn(move || {
let instance_handle = unsafe { GetModuleHandleA(null_mut()) };
info!("Create window {} {}", screen_width, screen_height);
let class_name = CString::new("D3D").expect("Couldnt create CString");
let class_name = CString::new("D3D").expect("Couldn't create CString");
let class_name_ptr = class_name.as_ptr();

let wc = WNDCLASSEXA {
Expand Down Expand Up @@ -952,7 +952,7 @@ impl Server for ServerInfo {
};
}
Some(tunnel::message_client::Msg::Key(event)) => {
if let Some((keycode, extened)) =
if let Some((keycode, extended)) =
utils_win::hardware_keycode_to_windows_scancode(event.keycode)
{
let mut input = INPUT {
Expand All @@ -967,7 +967,7 @@ impl Server for ServerInfo {
keyb.dwFlags |= KEYEVENTF_KEYUP;
}
keyb.dwFlags |= KEYEVENTF_SCANCODE;
if extened {
if extended {
keyb.dwFlags |= KEYEVENTF_EXTENDEDKEY;
}
keyb.time = 0;
Expand Down
10 changes: 5 additions & 5 deletions sanzu/src/server_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ fn connect_to_dbus(notif_sender: Sender<Notifications>) -> Result<dbus::blocking
dbus_conn.start_receive(
rule,
Box::new(move |msg, _| {
// TODO XXX we may want to filter special caracters ?
// TODO XXX we may want to filter special characters ?
let notifications = notification_extract_message(msg);
let notifications = Notifications { notifications };
notif_sender
Expand Down Expand Up @@ -779,7 +779,7 @@ pub fn init_x11rb(
.context("Error in damage create check")?;

conn.damage_subtract(damage, 0u32, 0u32)
.context("Error in damage substract")?;
.context("Error in damage subtract")?;

let screen_width = screen.width_in_pixels;
let screen_height = screen.height_in_pixels;
Expand All @@ -790,7 +790,7 @@ pub fn init_x11rb(
(screen_width, screen_height)
};

// Force the resolution to be less thant the server side
// Force the resolution to be less than the server side
let width = width.min(screen_width);
let height = height.min(screen_height);

Expand Down Expand Up @@ -843,7 +843,7 @@ pub fn init_x11rb(
}
}

/* Add root's chidren windows */
/* Add root's children windows */
let children = get_window_children(&conn, root).context("Cannot get root children")?;
debug!("ROOT Windows: {}", children.len());
for window in children {
Expand Down Expand Up @@ -911,7 +911,7 @@ pub fn init_x11rb(
let height = grabinfo.height;

del_custom_video_mode(&conn, window_info).context("Error in del_custom_video_mode")?;
// If we are already stucked in custom mode, update index accordingly
// If we are already stuck in custom mode, update index accordingly
let video_mode_index = usize::from(
utils_x11::get_video_mode(&conn, window_info, VIDEO_NAME_2)
.context("Error in get_video_mode")?
Expand Down
2 changes: 1 addition & 1 deletion sanzu/src/sound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ impl SoundDecoder {
real_output.into_iter().collect();
sound_q.lock().unwrap().append(&mut data);
{
// Forget old datas if we are lagging more than audio_buffer_ms
// Forget old data if we are lagging more than audio_buffer_ms
let sound_max_len =
(audio_buffer_ms as usize * SOUND_FREQ as usize * 2) / 1000;
let mut sound_data = sound_q.lock().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions sanzu/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub struct ServerArgsConfig {
long,
short = 's',
default_value_t = false,
help = "Seamless mode. Integrate remote windows in local environement"
help = "Seamless mode. Integrate remote windows in local environment"
)]
pub seamless: bool,
#[clap(
Expand Down Expand Up @@ -300,7 +300,7 @@ the video buffer is exfiltrated using guest/host shared memory instead of
tcp or vsock"
)]
pub extern_img_source: Option<String>,
#[clap(long, short = 'y', help = "Video source is xwd formated")]
#[clap(long, short = 'y', help = "Video source is xwd formatted")]
pub source_is_xwd: bool,
#[clap(
long,
Expand Down Expand Up @@ -396,7 +396,7 @@ pub struct ProxyArgsConfig {
help = "Use video source from file instead of video server api"
)]
pub extern_img_source: Option<String>,
#[clap(long, short = 'y', help = "Video source is xwd formated")]
#[clap(long, short = 'y', help = "Video source is xwd formatted")]
pub source_is_xwd: bool,
#[clap(
long,
Expand Down
2 changes: 1 addition & 1 deletion sanzu/src/utils_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ pub fn set_clipboard(clipboard: &Clipboard, selection: i32, value: &str) -> Resu
clipboard.getter.atoms.utf8_string,
value.as_bytes(),
)
.context("Error in clipboard strore")?;
.context("Error in clipboard store")?;
Ok(())
}

Expand Down
4 changes: 2 additions & 2 deletions sanzu/src/video_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl EncoderBuilder {
}
}

/// Set command line to exectue to retreive options on encoder regeneration
/// Set command line to execute to retrieve options on encoder regeneration
fn set_command(&mut self, command: &str) -> Result<()> {
debug!("set_command: {:?}", command);
self.command = Some(command.to_owned());
Expand All @@ -73,7 +73,7 @@ impl EncoderBuilder {
/// Generate FFmpeg encoder
fn open(mut self) -> Result<EncoderFFmpeg> {
if let Some(ref command) = &self.command {
info!("Spawn custom command retreive");
info!("Spawn custom command retrieve");
let child = process::Command::new(command)
.output()
.context("Cannot run ffmpeg options command")?;
Expand Down