fix return in websocket.rs/send_to_ipbl_websocket
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Paul 2023-11-25 17:35:48 +01:00
parent c681825efe
commit 46a01efeea

View File

@ -105,11 +105,13 @@ pub async fn send_to_ipbl_websocket(
Ok(_) => {}
Err(e) => {
println!("err send read: {e:?}");
return handle_websocket_error(ws);
ws.close(None).unwrap_or(());
return false;
}
};
} else {
return handle_websocket_error(ws);
ws.close(None).unwrap_or(());
return false;
};
if ws.can_read() {
@ -117,19 +119,13 @@ pub async fn send_to_ipbl_websocket(
Ok(_) => {}
Err(e) => {
println!("err send read: {e:?}");
return handle_websocket_error(ws);
ws.close(None).unwrap_or(());
return false;
}
};
} else {
return handle_websocket_error(ws);
ws.close(None).unwrap_or(());
return false;
};
true
}
fn handle_websocket_error(ws: &mut WebSocket<MaybeTlsStream<TcpStream>>) -> bool {
match ws.close(None) {
Ok(o) => {}
Err(e) => {}
};
return false;
}