From b8c1bd2cbaf0ed3fe2ddf9525c6bd1fab1bc3e06 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 12 May 2016 21:57:07 +0200 Subject: reset attempt count when reconnecting because of timeout --- .../java/eu/siacs/conversations/services/XmppConnectionService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 7301c7aa..977524d1 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -604,6 +604,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa long timeout = Config.CONNECT_TIMEOUT - secondsSinceLastConnect; if (timeout < 0) { Log.d(Config.LOGTAG, account.getJid() + ": time out during connect reconnecting"); + account.getXmppConnection().resetAttemptCount(); reconnectAccount(account, true, interactive); } else if (discoTimeout < 0) { account.getXmppConnection().sendDiscoTimeout(); @@ -2652,6 +2653,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa if (connection == null) { connection = createConnection(account); account.setXmppConnection(connection); + } else { + connection.interrupt(); } if (!account.isOptionSet(Account.OPTION_DISABLED)) { if (!force) { -- cgit v1.2.3