Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
indexds committed Jan 26, 2025
1 parent b24df79 commit d22b599
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/http/wg_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ pub fn set_routes(http_server: &mut EspHttpServer<'static>, nvs: Arc<Mutex<EspNv
let mut locked = WG_LOCK.lock().unwrap();
if *locked {
log::warn!("Wireguard connection already in progress!");

let connection = request.connection();

connection.initiate_response(204, Some("OK"), &[("Content-Type", "text/html")])?;

return Ok::<(), Error>(());
}
else {
} else {
*locked = true;
}
}
Expand Down Expand Up @@ -75,7 +74,6 @@ 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();

Expand Down

0 comments on commit d22b599

Please sign in to comment.