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:01:36 +03:00
parent 7731d17bac
commit 865c5deda2

View File

@ -49,8 +49,12 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, env: &JNIE
tokio::spawn(async move {
while let Ok(bytes) = rx.recv() {
lltx.send("Write to tun.".as_bytes().to_vec());
dev_writer.write_all(&bytes).await;
dev_writer.flush().await;
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());
}
}
});