introduced error code for server not opening stream after auth or starttls

This commit is contained in:
Daniel Gultsch 2018-09-27 17:39:49 +02:00
parent cf879dd8e8
commit 9816261569
3 changed files with 647 additions and 643 deletions

File diff suppressed because it is too large Load diff

View file

@ -398,6 +398,9 @@ public class XmppConnection implements Runnable {
break; // successfully connected to server that speaks xmpp
} else {
localSocket.close();
if (!iterator.hasNext()) {
throw new StateChangingException(Account.State.STREAM_OPENING_ERROR);
}
}
} catch (final StateChangingException e) {
throw e;
@ -520,7 +523,7 @@ public class XmppConnection implements Runnable {
if (tag != null && tag.isStart("stream")) {
processStream();
} else {
throw new IOException("server didn't restart stream after successful auth");
throw new StateChangingException(Account.State.STREAM_OPENING_ERROR);
}
break;
} else if (nextTag.isStart("failure")) {
@ -860,7 +863,7 @@ public class XmppConnection implements Runnable {
SSLSocketHelper.log(account, sslSocket);
processStream();
} else {
throw new IOException("server didn't restart stream after STARTTLS");
throw new StateChangingException(Account.State.STREAM_OPENING_ERROR);
}
sslSocket.close();
} catch (final NoSuchAlgorithmException | KeyManagementException e1) {

View file

@ -152,6 +152,7 @@
<string name="account_status_policy_violation">Policy violation</string>
<string name="account_status_incompatible_server">Incompatible server</string>
<string name="account_status_stream_error">Stream error</string>
<string name="account_status_stream_opening_error">Stream opening error</string>
<string name="encryption_choice_unencrypted">Unencrypted</string>
<string name="encryption_choice_otr">OTR</string>
<string name="encryption_choice_pgp">OpenPGP</string>