mirror of
https://codeberg.org/YGGverse/psocks.git
synced 2026-04-01 00:45:27 +00:00
rename some members; add documentation
This commit is contained in:
parent
eeafed077a
commit
8586a5b036
3 changed files with 12 additions and 5 deletions
|
|
@ -33,7 +33,7 @@ async fn api_allow(
|
|||
totals: &State<Arc<Total>>,
|
||||
) -> Result<Json<bool>, Status> {
|
||||
let result = list.allow(rule).await;
|
||||
totals.set_entries(list.entries().await);
|
||||
totals.set_entries(list.rules().await);
|
||||
info!("Delete `{rule}` from the in-memory rules (operation status: {result:?})");
|
||||
Ok(Json(result.map_err(|e| {
|
||||
error!("Allow request handle error for `{rule}`: `{e}`");
|
||||
|
|
@ -48,7 +48,7 @@ async fn api_block(
|
|||
totals: &State<Arc<Total>>,
|
||||
) -> Result<Json<bool>, Status> {
|
||||
let result = list.block(rule).await;
|
||||
totals.set_entries(list.entries().await);
|
||||
totals.set_entries(list.rules().await);
|
||||
info!("Add `{rule}` to the in-memory rules (operation status: {result:?})");
|
||||
Ok(Json(result.map_err(|e| {
|
||||
error!("Block request handle error for `{rule}`: `{e}`");
|
||||
|
|
@ -85,7 +85,7 @@ async fn rocket() -> _ {
|
|||
.unwrap(),
|
||||
);
|
||||
|
||||
let totals = Arc::new(Total::with_entries(list.entries().await));
|
||||
let totals = Arc::new(Total::with_rules(list.rules().await));
|
||||
|
||||
tokio::spawn({
|
||||
let socks_list = list.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue