summaryrefslogtreecommitdiffstats
path: root/src/client/encrypted.rs
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@blos.sm>2023-10-20 04:51:56 +0100
committerLibravatar cel 🌸 <cel@blos.sm>2023-10-20 04:51:56 +0100
commitba94ee66fafbabd63d6d1ed5edf435d4c46c6796 (patch)
treefe1bebc35914941b5c4fbd6f0286f4c9f8916154 /src/client/encrypted.rs
parent2536fa4937f0283b4187142cc6cede8e1dbfafa8 (diff)
downloadluz-ba94ee66fafbabd63d6d1ed5edf435d4c46c6796.tar.gz
luz-ba94ee66fafbabd63d6d1ed5edf435d4c46c6796.tar.bz2
luz-ba94ee66fafbabd63d6d1ed5edf435d4c46c6796.zip
WIP: refactor to parse incoming stream as state machine
Diffstat (limited to 'src/client/encrypted.rs')
-rw-r--r--src/client/encrypted.rs16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/client/encrypted.rs b/src/client/encrypted.rs
index 47b2b2c..263d5ff 100644
--- a/src/client/encrypted.rs
+++ b/src/client/encrypted.rs
@@ -2,36 +2,26 @@ use std::{collections::BTreeMap, str};
use quick_xml::{
events::{BytesDecl, Event},
- Reader, Writer,
+ NsReader, Writer,
};
use rsasl::prelude::{Mechname, SASLClient};
use tokio::io::{BufReader, ReadHalf, WriteHalf};
use tokio::net::TcpStream;
use tokio_native_tls::TlsStream;
-use crate::stanza::{
- bind::Bind,
- iq::IQ,
- sasl::{Challenge, Success},
- Element,
-};
-use crate::stanza::{
- sasl::{Auth, Response},
- stream::{Stream, StreamFeature},
-};
use crate::Jabber;
use crate::JabberError;
use crate::Result;
pub struct JabberClient<'j> {
- pub reader: Reader<BufReader<ReadHalf<TlsStream<TcpStream>>>>,
+ pub reader: NsReader<BufReader<ReadHalf<TlsStream<TcpStream>>>>,
pub writer: Writer<WriteHalf<TlsStream<TcpStream>>>,
jabber: &'j mut Jabber<'j>,
}
impl<'j> JabberClient<'j> {
pub fn new(
- reader: Reader<BufReader<ReadHalf<TlsStream<TcpStream>>>>,
+ reader: NsReader<BufReader<ReadHalf<TlsStream<TcpStream>>>>,
writer: Writer<WriteHalf<TlsStream<TcpStream>>>,
jabber: &'j mut Jabber<'j>,
) -> Self {