Skip to content

Commit

Permalink
fix: Send SASL message when state is Finished(Yes)
Browse files Browse the repository at this point in the history
This was a bug in the existing implementation that sometimes caused
issues, but that some kafka brokers appear to tolerate.
  • Loading branch information
einarmo committed Jan 3, 2025
1 parent 493d791 commit 25baeeb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,12 +605,14 @@ where
loop {
let mut to_sent = Cursor::new(Vec::new());
let state = session.step(data_received.as_deref(), &mut to_sent)?;
if !state.is_running() {

if state.has_sent_message() {
let authentication_response =
self.sasl_authentication(to_sent.into_inner()).await?;
data_received = Some(authentication_response.auth_bytes.0);
} else {
break;
}

let authentication_response = self.sasl_authentication(to_sent.into_inner()).await?;
data_received = Some(authentication_response.auth_bytes.0);
}

Ok(())
Expand Down

0 comments on commit 25baeeb

Please sign in to comment.