aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-12 21:57:07 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-12 21:57:07 +0200
commitb8c1bd2cbaf0ed3fe2ddf9525c6bd1fab1bc3e06 (patch)
tree4697093520b21fbb17f355bdf1f952dddc868b21
parent2014f388b1f5eef66c8f787dc6889b03ae461d08 (diff)
reset attempt count when reconnecting because of timeout
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java3
1 files changed, 3 insertions, 0 deletions
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) {