mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 13:32:07 +01:00
Throw exception to reduce call sites of notifyConnectionError()
in XMPPTCPConnection.
This commit is contained in:
parent
7d2c3ac9f9
commit
5da6dea138
1 changed files with 3 additions and 4 deletions
|
@ -973,14 +973,13 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void afterFeaturesReceived() throws NotConnectedException, InterruptedException {
|
protected void afterFeaturesReceived() throws NotConnectedException, InterruptedException, SecurityRequiredByServerException {
|
||||||
StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
|
StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
|
||||||
if (startTlsFeature != null) {
|
if (startTlsFeature != null) {
|
||||||
if (startTlsFeature.required() && config.getSecurityMode() == SecurityMode.disabled) {
|
if (startTlsFeature.required() && config.getSecurityMode() == SecurityMode.disabled) {
|
||||||
SmackException smackException = new SecurityRequiredByServerException();
|
SecurityRequiredByServerException smackException = new SecurityRequiredByServerException();
|
||||||
tlsHandled.reportFailure(smackException);
|
tlsHandled.reportFailure(smackException);
|
||||||
notifyConnectionError(smackException);
|
throw smackException;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getSecurityMode() != ConnectionConfiguration.SecurityMode.disabled) {
|
if (config.getSecurityMode() != ConnectionConfiguration.SecurityMode.disabled) {
|
||||||
|
|
Loading…
Reference in a new issue