diff options
| author | denis <denismaximov98@gmail.com> | 2021-03-18 15:28:00 +0200 |
|---|---|---|
| committer | Kunal Mohan <kunalmohan99@gmail.com> | 2021-05-04 20:47:50 +0530 |
| commit | 70d8be07417c023b27400b0f8c6c4ce736cf8cd2 (patch) | |
| tree | dbabd32e361e7bcfb83837e21277afc8bf089b46 /src | |
| parent | wip: here goes the os_thread and OsContext (diff) | |
| download | sl0ppij-70d8be07417c023b27400b0f8c6c4ce736cf8cd2.tar.gz sl0ppij-70d8be07417c023b27400b0f8c6c4ce736cf8cd2.tar.xz sl0ppij-70d8be07417c023b27400b0f8c6c4ce736cf8cd2.zip | |
wip: remove the commands that are called only on the client
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/errors.rs | 9 | ||||
| -rw-r--r-- | src/common/os_input_output.rs | 9 | ||||
| -rw-r--r-- | src/server/mod.rs | 28 |
3 files changed, 0 insertions, 46 deletions
diff --git a/src/common/errors.rs b/src/common/errors.rs index 37b3a2c7..3b5c8354 100644 --- a/src/common/errors.rs +++ b/src/common/errors.rs @@ -314,18 +314,9 @@ pub enum OsContext { impl From<&OsApiInstruction> for OsContext { fn from(os_instruction: &OsApiInstruction) -> Self { match *os_instruction { - OsApiInstruction::SpawnTerminal(_) => OsContext::SpawnTerminal, - OsApiInstruction::GetTerminalSizeUsingFd(_) => OsContext::GetTerminalSizeUsingFd, OsApiInstruction::SetTerminalSizeUsingFd(_, _, _) => OsContext::SetTerminalSizeUsingFd, - OsApiInstruction::SetRawMode(_) => OsContext::SetRawMode, - OsApiInstruction::UnsetRawMode(_) => OsContext::UnsetRawMode, - OsApiInstruction::ReadFromTtyStdout(_, _) => OsContext::ReadFromTtyStdout, OsApiInstruction::WriteToTtyStdin(_, _) => OsContext::WriteToTtyStdin, OsApiInstruction::TcDrain(_) => OsContext::TcDrain, - OsApiInstruction::Kill(_) => OsContext::Kill, - OsApiInstruction::ReadFromStdin => OsContext::ReadFromStdin, - OsApiInstruction::GetStdoutWriter => OsContext::GetStdoutWriter, - OsApiInstruction::BoxClone => OsContext::BoxClone } } } diff --git a/src/common/os_input_output.rs b/src/common/os_input_output.rs index 8a8cea14..0e7363ea 100644 --- a/src/common/os_input_output.rs +++ b/src/common/os_input_output.rs @@ -271,18 +271,9 @@ impl OsApi for OsInputOutput { #[derive(Serialize, Deserialize, Debug, Clone)] pub enum OsApiInstruction { - GetTerminalSizeUsingFd(RawFd), SetTerminalSizeUsingFd(RawFd, u16, u16), - SetRawMode(RawFd), - UnsetRawMode(RawFd), - SpawnTerminal(Option<PathBuf>), - ReadFromTtyStdout(RawFd, Vec<u8>), WriteToTtyStdin(RawFd, Vec<u8>), TcDrain(RawFd), - Kill(RawFd), - ReadFromStdin, - GetStdoutWriter, - BoxClone } impl Clone for Box<dyn OsApi> { diff --git a/src/server/mod.rs b/src/server/mod.rs index 3ca9e004..c1713918 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -131,25 +131,9 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> (thread::JoinHan .expect("failed to receive an event on the channel"); err_ctx.add_call(ContextType::Os(OsContext::from(&event))); match event { - OsApiInstruction::SpawnTerminal(file_to_open) => { - os_input.spawn_terminal(file_to_open); - } - OsApiInstruction::GetTerminalSizeUsingFd(fd) => { - os_input.get_terminal_size_using_fd(fd); - } OsApiInstruction::SetTerminalSizeUsingFd(fd, cols, rows) => { os_input.set_terminal_size_using_fd(fd, cols, rows); } - OsApiInstruction::SetRawMode(fd) => { - os_input.set_raw_mode(fd); - } - OsApiInstruction::UnsetRawMode(fd) => { - os_input.unset_raw_mode(fd); - } - OsApiInstruction::ReadFromTtyStdout(fd, mut buf) => { - let slice = buf.as_mut_slice(); - os_input.read_from_tty_stdout(fd, slice).unwrap(); - } OsApiInstruction::WriteToTtyStdin(fd, mut buf) => { let slice = buf.as_mut_slice(); os_input.write_to_tty_stdin(fd, slice).unwrap(); @@ -157,18 +141,6 @@ pub fn start_server(os_input: Box<dyn OsApi>, opts: CliArgs) -> (thread::JoinHan OsApiInstruction::TcDrain(fd) => { os_input.tcdrain(fd).unwrap(); } - OsApiInstruction::Kill(pid) => { - os_input.kill(pid).unwrap(); - } - OsApiInstruction::ReadFromStdin => { - os_input.read_from_stdin(); - } - OsApiInstruction::GetStdoutWriter => { - os_input.get_stdout_writer(); - } - OsApiInstruction::BoxClone => { - os_input.box_clone(); - } } } }) |
