From aabd19f78cc54534b30f7a214a76b6fc6198f852 Mon Sep 17 00:00:00 2001 From: xmppftw Date: Tue, 19 Dec 2023 20:20:03 +0100 Subject: [PATCH] State is disconnected, not invalid --- tokio-xmpp/src/client/async_client.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tokio-xmpp/src/client/async_client.rs b/tokio-xmpp/src/client/async_client.rs index 4f85185..4cb5228 100644 --- a/tokio-xmpp/src/client/async_client.rs +++ b/tokio-xmpp/src/client/async_client.rs @@ -133,7 +133,10 @@ impl Stream for Client { self.state = ClientState::Connecting(connect); self.poll_next(cx) } - ClientState::Disconnected => Poll::Ready(None), + ClientState::Disconnected => { + self.state = ClientState::Disconnected; + Poll::Pending + } ClientState::Connecting(mut connect) => match Pin::new(&mut connect).poll(cx) { Poll::Ready(Ok(Ok(stream))) => { let bound_jid = stream.jid.clone();