Skip to content

Commit

Permalink
fix: client & server bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
skifli authored Oct 1, 2024
1 parent c335a82 commit a356333
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bruty_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bruty_client"
authors = ["skifli"]
version = "0.2.6"
version = "0.2.7"
edition = "2021"

[dependencies]
Expand Down
10 changes: 9 additions & 1 deletion bruty_client/src/client_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ pub async fn id_checker(
let url_base = "https://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=".to_string();

loop {
let id = id_receiver.recv_async().await.unwrap(); // Await an ID to check
let id = id_receiver.recv_async().await;

if id.is_err() {
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;

continue;
}

let id = id.unwrap();

let id_vec = id.clone();
let id_str = id.iter().collect::<String>();
Expand Down
2 changes: 1 addition & 1 deletion bruty_server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bruty_server"
authors = ["skifli"]
version = "0.2.6"
version = "0.2.7"
edition = "2021"

[dependencies]
Expand Down
5 changes: 2 additions & 3 deletions bruty_server/src/server_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub async fn results_progress_handler(
}

if awaiting_current_id_update.len() > 0 {
for (index, id) in awaiting_current_id_update.clone().iter().enumerate() {
for id in awaiting_current_id_update.clone() {
// Only want to update current ID when all awaiting IDs start with current ID.
// This means that we are not waiting for any results from the previous current ID.

Expand Down Expand Up @@ -150,12 +150,11 @@ pub async fn results_progress_handler(
} else {
if cant_update_awaiting_results != awaiting_current_id_update {
log::warn!(
"Can't update current ID to {:?}[{}], awaiting {:?}",
"Can't update current ID to {:?}, awaiting {:?}",
awaiting_current_id_update
.iter()
.map(|x| x.iter().collect::<String>())
.collect::<Vec<String>>(),
index,
awaiting_results
.iter()
.map(|x| x.iter().collect::<String>())
Expand Down

0 comments on commit a356333

Please sign in to comment.