reset attempt count when reconnecting because of timeout

This commit is contained in:
Daniel Gultsch 2016-05-12 21:57:07 +02:00
parent 2014f388b1
commit b8c1bd2cba

View file

@ -604,6 +604,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
long timeout = Config.CONNECT_TIMEOUT - secondsSinceLastConnect; long timeout = Config.CONNECT_TIMEOUT - secondsSinceLastConnect;
if (timeout < 0) { if (timeout < 0) {
Log.d(Config.LOGTAG, account.getJid() + ": time out during connect reconnecting"); Log.d(Config.LOGTAG, account.getJid() + ": time out during connect reconnecting");
account.getXmppConnection().resetAttemptCount();
reconnectAccount(account, true, interactive); reconnectAccount(account, true, interactive);
} else if (discoTimeout < 0) { } else if (discoTimeout < 0) {
account.getXmppConnection().sendDiscoTimeout(); account.getXmppConnection().sendDiscoTimeout();
@ -2652,6 +2653,8 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
if (connection == null) { if (connection == null) {
connection = createConnection(account); connection = createConnection(account);
account.setXmppConnection(connection); account.setXmppConnection(connection);
} else {
connection.interrupt();
} }
if (!account.isOptionSet(Account.OPTION_DISABLED)) { if (!account.isOptionSet(Account.OPTION_DISABLED)) {
if (!force) { if (!force) {