fix android vpn permission grant (#2023)

* fix android vpn permission grant
* fix url input behaviour
This commit is contained in:
KKRainbow
2026-03-29 23:16:32 +08:00
committed by GitHub
parent 7e289865b2
commit a1bec48dc9
22 changed files with 496 additions and 162 deletions
+10 -4
View File
@@ -227,11 +227,17 @@ impl NetworkInstanceManager {
}
pub fn set_tun_fd(&self, instance_id: &uuid::Uuid, fd: i32) -> Result<(), anyhow::Error> {
let mut instance = self
let sender = self
.instance_map
.get_mut(instance_id)
.ok_or_else(|| anyhow::anyhow!("instance not found"))?;
instance.set_tun_fd(fd);
.get(instance_id)
.ok_or_else(|| anyhow::anyhow!("instance not found"))?
.get_tun_fd_sender()
.ok_or_else(|| anyhow::anyhow!("tun fd sender not found"))?;
sender
.try_send(Some(fd))
.map_err(|e| anyhow::anyhow!("failed to send tun fd: {}", e))?;
Ok(())
}