mirror of
https://mirror.suhoan.cn/https://github.com/EasyTier/EasyTier.git
synced 2025-12-16 14:47:25 +08:00
fix bugs
add timeout for wss try_accept public server should show stats use default values for flags bump version to 2.0.0
This commit is contained in:
@@ -23,7 +23,15 @@ impl PeerManagerRpcService {
|
||||
}
|
||||
|
||||
pub async fn list_peers(&self) -> Vec<PeerInfo> {
|
||||
let peers = self.peer_manager.get_peer_map().list_peers().await;
|
||||
let mut peers = self.peer_manager.get_peer_map().list_peers().await;
|
||||
peers.extend(
|
||||
self.peer_manager
|
||||
.get_foreign_network_client()
|
||||
.get_peer_map()
|
||||
.list_peers()
|
||||
.await
|
||||
.iter(),
|
||||
);
|
||||
let mut peer_infos = Vec::new();
|
||||
for peer in peers {
|
||||
let mut peer_info = PeerInfo::default();
|
||||
@@ -31,6 +39,14 @@ impl PeerManagerRpcService {
|
||||
|
||||
if let Some(conns) = self.peer_manager.get_peer_map().list_peer_conns(peer).await {
|
||||
peer_info.conns = conns;
|
||||
} else if let Some(conns) = self
|
||||
.peer_manager
|
||||
.get_foreign_network_client()
|
||||
.get_peer_map()
|
||||
.list_peer_conns(peer)
|
||||
.await
|
||||
{
|
||||
peer_info.conns = conns;
|
||||
}
|
||||
|
||||
peer_infos.push(peer_info);
|
||||
|
||||
Reference in New Issue
Block a user