From a6f5a44c6ade8c6045304c5a2107345605b9f58e Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Mon, 10 Apr 2023 16:44:53 +0200 Subject: [PATCH] updated error handling --- src/ipblc.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ipblc.rs b/src/ipblc.rs index ad63fd3..d9af7fe 100644 --- a/src/ipblc.rs +++ b/src/ipblc.rs @@ -71,12 +71,13 @@ pub async fn run() { hostname: gethostname(true), ipdata: ip_to_send, }; - let status = send_to_ipbl_websocket(&mut wssocketrr, &ipe).await; - if !status { + if !send_to_ipbl_websocket(&mut wssocketrr, &ipe).await { + drop(ctx); wssocketrr = websocketreqrep(&ctxwsrr).await; - continue; + break; } } + continue } @@ -96,6 +97,7 @@ pub async fn run() { send_to_ipbl_api(&ctx.client, &ctx.flags.server, &ipe).await; let status = send_to_ipbl_websocket(&mut wssocketrr, &ipe).await; if !status { + drop(ctx); wssocketrr = websocketreqrep(&ctxwsrr).await; continue; }