fix return in websocket.rs/send_to_ipbl_websocket
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
c681825efe
commit
46a01efeea
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user