Skip to content

Commit bfd536e

Browse files
committed
Send SASL message when state is Finished(Yes)
This was a bug in the existing implementation that sometimes caused issues, but that some kafka brokers appear to tolerate.
1 parent 493d791 commit bfd536e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/messenger.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,12 +605,16 @@ where
605605
loop {
606606
let mut to_sent = Cursor::new(Vec::new());
607607
let state = session.step(data_received.as_deref(), &mut to_sent)?;
608+
609+
if state.has_sent_message() {
610+
let authentication_response =
611+
self.sasl_authentication(to_sent.into_inner()).await?;
612+
data_received = Some(authentication_response.auth_bytes.0);
613+
}
614+
608615
if !state.is_running() {
609616
break;
610617
}
611-
612-
let authentication_response = self.sasl_authentication(to_sent.into_inner()).await?;
613-
data_received = Some(authentication_response.auth_bytes.0);
614618
}
615619

616620
Ok(())

0 commit comments

Comments
 (0)