Skip to content

Commit

Permalink
Make sure we don't infloop when no readable message is found
Browse files Browse the repository at this point in the history
  • Loading branch information
lionel- committed Jun 28, 2023
1 parent dfff3c9 commit 1c423a6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions crates/amalthea/src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,12 @@ impl Kernel {
}
);

while n > 0 {
for _ in 0..n {
if let Some(index) = has_outbound() {
unwrap!(
forward_outbound(index),
Err(err) => error!("While forwarding outbound message: {}", err)
);

let _ = --n;
continue;
}

Expand All @@ -461,10 +459,10 @@ impl Kernel {
forward_inbound(),
Err(err) => error!("While forwarding inbound message: {}", err)
);

let _ = --n;
continue;
}

log::warn!("Could not find readable message");
}
}
}
Expand Down

0 comments on commit 1c423a6

Please sign in to comment.