refact, flutter sessions lock

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-10-03 09:51:21 +08:00
parent b02f169764
commit 06987c4ca9
9 changed files with 188 additions and 170 deletions

View File

@@ -75,7 +75,7 @@ pub async fn listen(
let interface = interface.clone();
tokio::spawn(async move {
if let Err(err) = run_forward(forward, stream).await {
interface.msgbox("error", "Error", &err.to_string(), "");
interface.msgbox("error", "Error", &err.to_string(), "");
}
log::info!("connection from {:?} closed", addr);
});
@@ -121,7 +121,6 @@ async fn connect_and_login(
let (mut stream, direct, _pk) =
Client::start(id, key, token, conn_type, interface.clone()).await?;
interface.update_direct(Some(direct));
let mut interface = interface;
let mut buffer = Vec::new();
let mut received = false;
loop {