tokio-xmpp: Refactor to provide channel-binding for ktls

Instead of having a second method to fetch channel-binding from the
TlsStream, do it directly in the connect() method, since after that we
don’t have enough information to fetch it any longer when using ktls.
This commit is contained in:
Emmanuel Gil Peyrot 2024-12-18 18:17:39 +01:00 committed by xmpp ftw
commit 897c2abe0b
5 changed files with 61 additions and 77 deletions

View file

@ -16,7 +16,7 @@ pub async fn component_login<C: ServerConnector>(
timeouts: Timeouts,
) -> Result<XmppStream<C::Stream>, Error> {
let password = password;
let mut stream = connector.connect(&jid, ns::COMPONENT, timeouts).await?;
let (mut stream, _) = connector.connect(&jid, ns::COMPONENT, timeouts).await?;
let header = stream.take_header();
let mut stream = stream.skip_features();
let stream_id = match header.id {