modified: src/client.rs
All checks were successful
gitea/Frida-android-native/pipeline/head This commit looks good

This commit is contained in:
Michael Wain 2024-10-08 18:09:01 +03:00
parent 865c5deda2
commit 92fbc69b7e

View File

@ -47,13 +47,15 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, env: &JNIE
let lltx = ltx.clone();
tokio::spawn(async move {
while let Ok(bytes) = rx.recv() {
lltx.send("Write to tun.".as_bytes().to_vec());
if let Err(e) = dev_writer.write_all(&bytes).await {
lltx.send(format!("Writing error: {:?}", e).as_bytes().to_vec());
}
if let Err(e) = dev_writer.flush().await {
lltx.send(format!("Flushing error: {:?}", e).as_bytes().to_vec());
loop {
if let Ok(bytes) = rx.recv() {
lltx.send("Write to tun.".as_bytes().to_vec());
if let Err(e) = dev_writer.write_all(&bytes).await {
lltx.send(format!("Writing error: {:?}", e).as_bytes().to_vec());
}
if let Err(e) = dev_writer.flush().await {
lltx.send(format!("Flushing error: {:?}", e).as_bytes().to_vec());
}
}
}
});