Skip to content

Commit

Permalink
Make simple_auth longer to reduce variation
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Vassor committed Apr 17, 2024
1 parent 589e1b5 commit b461134
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
async fn C(role: &mut C) -> Result<(), Box<dyn Error>> {
try_session(role, |s: AuthC<'_, _>| async {
let mut s = s.send(SetPw(10)).await?;
let mut s = s.send(SetPw(10000000)).await?;
let mut cur_attempt = 0;
loop {
let s_send = s.send(Password(cur_attempt)).await?;
cur_attempt += 1;
match s_send.branch().await? {
AuthC3::Success(_, s_bra) => {
println!("Success");
println!("Success ({} attempts)", cur_attempt);
return Ok(((), s_bra));
}
AuthC3::Failure(_, s_bra) => {
println!("Failure");
//println!("Failure");
let (_, s_retres) = s_bra.receive().await?;
s = s_retres.send(RetRes(0)).await?;
}
Expand Down

0 comments on commit b461134

Please sign in to comment.