From cdc3183d9eb234feb2e8ca3d3019b78cce73bcf6 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 24 Mar 2014 20:39:59 +0100 Subject: Introduce two new bool, to know if the xmpp component should try to reconnect If we never succeeded our connection+auth process, means we should probably not attempt any-more, and just give up. If we ever did, this means a reconnect is a good idea --- src/xmpp/xmpp_component.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/xmpp/xmpp_component.cpp') diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index 5400535..d083190 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -24,6 +24,8 @@ #define STREAMS_NS "urn:ietf:params:xml:ns:xmpp-streams" XmppComponent::XmppComponent(const std::string& hostname, const std::string& secret): + ever_auth(false), + last_auth(false), served_hostname(hostname), secret(secret), authenticated(false), @@ -144,6 +146,7 @@ void XmppComponent::on_remote_stream_open(const XmlNode& node) return ; } + this->last_auth = false; // Try to authenticate char digest[HASH_LENGTH * 2 + 1]; sha1nfo sha1; @@ -212,6 +215,8 @@ void XmppComponent::handle_handshake(const Stanza& stanza) { (void)stanza; this->authenticated = true; + this->ever_auth = true; + this->last_auth = true; log_info("Authenticated with the XMPP server"); } -- cgit v1.2.3