mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-03 01:25:37 +00:00
multi_fix: harden peer/session handling, tighten foreign-network trust, and improve web client metadata (#1999)
* machine-id should be scoped unbder same user-id * feat: report device os metadata to console * fix sync root key cause packet loss * fix tun packet not invalid * fix faketcp cause lat jitter * fix some packet not decrypt * fix peer info patch, improve performance of update self info * fix foreign credential identity mismatch handling
This commit is contained in:
@@ -278,13 +278,9 @@ impl PeerMap {
|
||||
|
||||
pub async fn list_peers_with_conn(&self) -> Vec<PeerId> {
|
||||
let mut ret = Vec::new();
|
||||
let peers = self.list_peers();
|
||||
for peer_id in peers.iter() {
|
||||
let Some(peer) = self.get_peer_by_id(*peer_id) else {
|
||||
continue;
|
||||
};
|
||||
if !peer.list_peer_conns().await.is_empty() {
|
||||
ret.push(*peer_id);
|
||||
for item in self.peer_map.iter() {
|
||||
if item.value().has_live_conns() {
|
||||
ret.push(*item.key());
|
||||
}
|
||||
}
|
||||
ret
|
||||
@@ -308,6 +304,11 @@ impl PeerMap {
|
||||
.and_then(|p| p.get_peer_identity_type())
|
||||
}
|
||||
|
||||
pub fn get_peer_public_key(&self, peer_id: PeerId) -> Option<Vec<u8>> {
|
||||
self.get_peer_by_id(peer_id)
|
||||
.and_then(|p| p.get_peer_public_key())
|
||||
}
|
||||
|
||||
pub async fn close_peer_conn(
|
||||
&self,
|
||||
peer_id: PeerId,
|
||||
|
||||
Reference in New Issue
Block a user