Commit b655b289 authored by nanamicat's avatar nanamicat

fix

parent 40d50415
Pipeline #42141 passed with stages
in 1 minute and 43 seconds
......@@ -15,7 +15,6 @@ mod connection;
mod data;
mod gateway_group;
mod protocol;
mod route_writer;
mod router;
mod server;
mod settings;
......
use crate::router::Router;
use crate::settings::ROUTE_PROTOCOL;
use crate::{connection::Connection, data, protocol::Change};
use futures::TryStreamExt;
......@@ -53,14 +52,13 @@ impl Server {
// pub fn update(&mut self, socket: &UdpSocket, routers: &mut HashMap<u8, Router>, hello: &Hello) {
// }
pub async fn reset(&self, routers: &Vec<data::Router>, connections: &BTreeMap<u8, Connection>) -> anyhow::Result<()> {
pub async fn reset(&self, routers: &Vec<data::Router>, connections: &BTreeMap<u8, Connection>) {
let mut routes = self.handle.route().get(RouteMessageBuilder::<Ipv4Addr>::new().protocol(ROUTE_PROTOCOL).build()).execute();
while let Some(route) = routes.try_next().await? {
self.handle.route().del(route).execute().await?;
while let Some(route) = routes.try_next().await.unwrap() {
self.handle.route().del(route).execute().await.unwrap();
}
// for router in routers.iter() {
// if()
// }
Ok(())
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment