don’t let attempt count fall below zero
This commit is contained in:
parent
c37b5af2ca
commit
8e3948e495
|
@ -355,7 +355,7 @@ public class XmppConnection implements Runnable {
|
||||||
} catch (final IOException | XmlPullParserException | NoSuchAlgorithmException e) {
|
} catch (final IOException | XmlPullParserException | NoSuchAlgorithmException e) {
|
||||||
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": " + e.getMessage());
|
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": " + e.getMessage());
|
||||||
this.changeStatus(Account.State.OFFLINE);
|
this.changeStatus(Account.State.OFFLINE);
|
||||||
this.attempt--; //don't count attempt when reconnecting instantly anyway
|
this.attempt = Math.max(0, this.attempt - 1);
|
||||||
} finally {
|
} finally {
|
||||||
forceCloseSocket();
|
forceCloseSocket();
|
||||||
if (wakeLock.isHeld()) {
|
if (wakeLock.isHeld()) {
|
||||||
|
|
Loading…
Reference in New Issue