diff --git a/src/api.rs b/src/api.rs index 72ed6ef..3fa069e 100644 --- a/src/api.rs +++ b/src/api.rs @@ -34,9 +34,7 @@ pub async fn apiserver(ctxarc: &Arc>) -> io::Result<()> { Ok(dt) => { let (_reader, mut writer) = stream.into_split(); match writer.write_all(format!("{dt}").as_bytes()).await { - Ok(a) => { - println!("{a:?}"); - } + Ok(_) => {} Err(err) => { println!("{err}"); } diff --git a/src/ipblc.rs b/src/ipblc.rs index 63e98ac..b77d5b9 100644 --- a/src/ipblc.rs +++ b/src/ipblc.rs @@ -102,7 +102,12 @@ pub async fn run() { toblock = ctx.get_blocklist_toblock().await; } // apply firewall blocking - fwblock(&toblock, &mut ret, &mut fwlen).unwrap(); + match fwblock(&toblock, &mut ret, &mut fwlen) { + Ok(_) => {} + Err(err) => { + println!("Err: {err}, unable to push firewall rules, use super user") + } + }; // log lines if ret.len() > 0 { diff --git a/src/utils.rs b/src/utils.rs index a746e14..3b754ca 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -33,7 +33,7 @@ pub fn _dedup(list: &mut Vec) -> usize { list.len() } -pub async fn sleep_ms(ms: u64) { +pub async fn _sleep_ms(ms: u64) { sleep(Duration::from_millis(ms)).await; }