mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-21 22:02:06 +01:00
Move TLS and SASL sync points into subclasses
In preperation of subclasses with different connection approaches.
This commit is contained in:
parent
5e25491877
commit
793d3c47ad
4 changed files with 6 additions and 11 deletions
|
@ -201,9 +201,6 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
+ getHost() + ":" + getPort() + ".";
|
||||
throw new SmackException(errorMessage);
|
||||
}
|
||||
|
||||
tlsHandled.reportSuccess();
|
||||
saslFeatureReceived.reportSuccess();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue