modified: src/client.rs
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit
Some checks failed
gitea/Frida-android-native/pipeline/head There was a failure building this commit
This commit is contained in:
parent
22c918b782
commit
055e127475
@ -46,12 +46,13 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, close_toke
|
|||||||
|
|
||||||
let cipher_shared: Arc<Mutex<Option<x25519_dalek::SharedSecret>>> = Arc::new(Mutex::new(None));
|
let cipher_shared: Arc<Mutex<Option<x25519_dalek::SharedSecret>>> = Arc::new(Mutex::new(None));
|
||||||
|
|
||||||
let cancel_dr = close_token.clone();
|
let cancel_dr = subtasks_quit.clone();
|
||||||
let dev_read_task = tokio::spawn(async move {
|
let dev_read_task = tokio::spawn(async move {
|
||||||
let mut buf = vec![0; 1400]; // mtu
|
let mut buf = vec![0; 1400]; // mtu
|
||||||
loop {
|
loop {
|
||||||
|
let sf = cancel_dr.lock().unwrap();
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = subtasks_quit.lock().unwrap().cancelled() => {
|
_ = sf.cancelled() => {
|
||||||
info!("Cancellation token has been thrown dev_read_task");
|
info!("Cancellation token has been thrown dev_read_task");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -62,19 +63,21 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, close_toke
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
drop(sf);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let priv_key = BASE64_STANDARD.decode(client_config.client.private_key).unwrap();
|
let priv_key = BASE64_STANDARD.decode(client_config.client.private_key).unwrap();
|
||||||
|
|
||||||
let cipher_shared_clone = cipher_shared.clone();
|
let cipher_shared_clone = cipher_shared.clone();
|
||||||
let cancel_sr = close_token.clone();
|
let cancel_sr = subtasks_quit.clone();
|
||||||
let sock_read_task = tokio::spawn(async move {
|
let sock_read_task = tokio::spawn(async move {
|
||||||
let mut buf = vec![0; 4096];
|
let mut buf = vec![0; 4096];
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
let sf = cancel_sr.lock().unwrap();
|
||||||
tokio::select! {
|
tokio::select! {
|
||||||
_ = subtasks_quit.lock().unwrap().cancelled() => {
|
_ = sf.cancelled() => {
|
||||||
info!("Cancellation token has been thrown sock_read_task");
|
info!("Cancellation token has been thrown sock_read_task");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -121,6 +124,7 @@ pub async fn client_mode(client_config: ClientConfiguration, fd: i32, close_toke
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
drop(sf);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user