Skip to content

Commit

Permalink
hotfix + format
Browse files Browse the repository at this point in the history
  • Loading branch information
indexds committed Jan 23, 2025
1 parent 92c21ab commit 3b41653
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ esp_idf_sdkconfig="sdkconfig"

[dependencies]
log = { version = "0.4", default-features = false }
esp-idf-svc = { version = "0.51", default-features = false, features = ["std"] }
esp-idf-svc = { version = "0.50.1", default-features = false, features = ["std"] }
embedded-svc = { version = "0.28", default-features = true }
heapless = { version = "0.8", default-features = false }
anyhow = { version = "1.0", default-features = false }
Expand Down
8 changes: 3 additions & 5 deletions src/http/wg_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ pub fn set_routes(http_server: &mut EspHttpServer<'static>, nvs: Arc<Mutex<EspNv
if *locked {
log::warn!("Wireguard connection already in progress!");
return Ok(());
}
else {
} else {
*locked = true;
}

Expand Down Expand Up @@ -66,13 +65,12 @@ pub fn set_routes(http_server: &mut EspHttpServer<'static>, nvs: Arc<Mutex<EspNv

// Handler to disconnect from the wireguard peer
http_server.fn_handler("/disconnect-wg", Method::Get, move |mut request| {
let locked = WG_LOCK.lock().unwrap();
let mut locked = WG_LOCK.lock().unwrap();

if !*locked {
log::warn!("No wireguard connection found for disconnection attempt!");
return Ok(());
}
else {
} else {
*locked = false;
}

Expand Down

0 comments on commit 3b41653

Please sign in to comment.