diff options
Diffstat (limited to '')
-rw-r--r-- | src/client/unencrypted.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client/unencrypted.rs b/src/client/unencrypted.rs index 74b800c..d4225d3 100644 --- a/src/client/unencrypted.rs +++ b/src/client/unencrypted.rs @@ -115,14 +115,12 @@ impl<'j> JabberClient<'j> { .connect(&self.jabber.server, stream) .await { - let (read, write) = tokio::io::split(tlsstream); + let (read, writer) = tokio::io::split(tlsstream); let reader = Reader::from_reader(BufReader::new(read)); - let writer = Writer::new(write); - return Ok(super::encrypted::JabberClient::new( - reader, - writer, - self.jabber, - )); + let mut client = + super::encrypted::JabberClient::new(reader, writer, self.jabber); + client.start_stream().await?; + return Ok(client); } } QName(_) => return Err(JabberError::TlsNegotiation), |