let mut output: String = String::new(); match msg.read_until(b'\n', &mut buffer) { Err(_) => panic!("Reading Failed"), _ => {} } match from_utf8(&buffer) { Ok(s) => { output.push_str(s); return output; } Err(e) => { panic!("Buffer invalid: {}", e); } } /* pub fn reverse_shell_listener(){ let mut counter: i8 = 0; let inc: TcpStream = listener("0.0.0.0".to_string(), 23234); let inc_clone = match inc.try_clone() { Ok(c) => c, Err(_) => return }; let t1 = if let Some(t) = pipe_thread(std::io::stdin(), inc_clone) { counter += 1; t } else { return }; let t2 = match pipe_thread(inc, std::io::stdout()){ Some(t) => { counter += 1; t }, None => return }; if counter == 2{ match t1.join() { Ok(_) => {}, Err(_) => return } match t2.join() { Ok(_) => {}, Err(_) => return } } }*/ /* fn run_rsl_threads(t1: Rsljh, t2: Rsljh) -> Result<(), Error>{ t1.join()?; t2.join()?; Ok(()) } */ /* #[cfg(test)] mod tests { use super::*; #[test] fn it_works() { let result = add(2, 2); assert_eq!(result, 4); } }*/