Move TLS and SASL sync points into subclasses

In preperation of subclasses with different connection approaches.
This commit is contained in:
Florian Schmaus 2018-02-20 09:01:11 +01:00
parent 5e25491877
commit 793d3c47ad
4 changed files with 6 additions and 11 deletions

View File

@ -201,9 +201,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
+ getHost() + ":" + getPort() + ".";
throw new SmackException(errorMessage);
}
tlsHandled.reportSuccess();
saslFeatureReceived.reportSuccess();
}
@Override

View File

@ -379,12 +379,6 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
// Perform the actual connection to the XMPP service
connectInternal();
// TLS handled will be successful either if TLS was established, or if it was not mandatory.
tlsHandled.checkIfSuccessOrWaitOrThrow();
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
// If TLS is required but the server doesn't offer it, disconnect
// from the server and throw an error. First check if we've already negotiated TLS
// and are secure, however (features get parsed a second time after TLS is established).

View File

@ -92,8 +92,6 @@ public class DummyConnection extends AbstractXMPPConnection {
@Override
protected void connectInternal() {
connected = true;
saslFeatureReceived.reportSuccess();
tlsHandled.reportSuccess();
streamId = "dummy-" + new Random(new Date().getTime()).nextInt();
// TODO: Remove in Smack 4.3, and likely the suppression of the deprecation warning.

View File

@ -903,6 +903,12 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
// We connected successfully to the servers TCP port
initConnection();
// TLS handled will be successful either if TLS was established, or if it was not mandatory.
tlsHandled.checkIfSuccessOrWaitOrThrow();
// Wait with SASL auth until the SASL mechanisms have been received
saslFeatureReceived.checkIfSuccessOrWaitOrThrow();
}
/**