summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/ClientSession.cpp')
-rw-r--r--Swiften/Client/ClientSession.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp
index bb9be58..4e34417 100644
--- a/Swiften/Client/ClientSession.cpp
+++ b/Swiften/Client/ClientSession.cpp
@@ -119,13 +119,13 @@ void ClientSession::sendStanza(std::shared_ptr<Stanza> stanza) {
if (stanzaAckRequester_) {
stanzaAckRequester_->handleStanzaSent(stanza);
}
}
void ClientSession::handleStreamStart(const ProtocolHeader&) {
- CHECK_STATE_OR_RETURN(State::WaitingForStreamStart);
+ CHECK_STATE_OR_RETURN(State::WaitingForStreamStart)
state = State::Negotiating;
}
void ClientSession::handleStreamEnd() {
if (state == State::Finishing) {
// We are already in finishing state if we iniated the close of the session.
@@ -211,13 +211,13 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
stanzaAckResponder_->handleStanzaReceived();
}
onStanzaReceived(stanza);
}
}
else if (StreamFeatures* streamFeatures = dynamic_cast<StreamFeatures*>(element.get())) {
- CHECK_STATE_OR_RETURN(State::Negotiating);
+ CHECK_STATE_OR_RETURN(State::Negotiating)
if (streamFeatures->hasStartTLS() && stream->supportsTLSEncryption() && useTLS != NeverUseTLS) {
state = State::WaitingForEncrypt;
stream->writeElement(std::make_shared<StartTLSRequest>());
}
else if (useTLS == RequireTLS && !stream->isTLSEncrypted()) {
@@ -317,13 +317,13 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
else {
continueSessionInitialization();
}
}
}
else if (std::dynamic_pointer_cast<Compressed>(element)) {
- CHECK_STATE_OR_RETURN(State::Compressing);
+ CHECK_STATE_OR_RETURN(State::Compressing)
state = State::WaitingForStreamStart;
stream->addZLibCompression();
stream->resetXMPPParser();
sendStreamHeader();
}
else if (std::dynamic_pointer_cast<CompressFailure>(element)) {
@@ -340,13 +340,13 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
}
else if (std::dynamic_pointer_cast<StreamManagementFailed>(element)) {
needAcking = false;
continueSessionInitialization();
}
else if (AuthChallenge* challenge = dynamic_cast<AuthChallenge*>(element.get())) {
- CHECK_STATE_OR_RETURN(State::Authenticating);
+ CHECK_STATE_OR_RETURN(State::Authenticating)
assert(authenticator);
if (authenticator->setChallenge(challenge->getValue())) {
stream->writeElement(std::make_shared<AuthResponse>(authenticator->getResponse()));
}
#ifdef SWIFTEN_PLATFORM_WIN32
else if (WindowsGSSAPIClientAuthenticator* gssapiAuthenticator = dynamic_cast<WindowsGSSAPIClientAuthenticator*>(authenticator)) {
@@ -358,13 +358,13 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
#endif
else {
finishSession(Error::AuthenticationFailedError);
}
}
else if (AuthSuccess* authSuccess = dynamic_cast<AuthSuccess*>(element.get())) {
- CHECK_STATE_OR_RETURN(State::Authenticating);
+ CHECK_STATE_OR_RETURN(State::Authenticating)
assert(authenticator);
if (!authenticator->setChallenge(authSuccess->getValue())) {
finishSession(Error::ServerVerificationFailedError);
}
else {
state = State::WaitingForStreamStart;
@@ -375,13 +375,13 @@ void ClientSession::handleElement(std::shared_ptr<ToplevelElement> element) {
}
}
else if (dynamic_cast<AuthFailure*>(element.get())) {
finishSession(Error::AuthenticationFailedError);
}
else if (dynamic_cast<TLSProceed*>(element.get())) {
- CHECK_STATE_OR_RETURN(State::WaitingForEncrypt);
+ CHECK_STATE_OR_RETURN(State::WaitingForEncrypt)
state = State::Encrypting;
stream->addTLSEncryption();
}
else if (dynamic_cast<StartTLSFailure*>(element.get())) {
finishSession(Error::TLSError);
}
@@ -430,13 +430,13 @@ void ClientSession::sendCredentials(const SafeByteArray& password) {
authenticator->setCredentials(localJID.getNode(), password);
stream->writeElement(std::make_shared<AuthRequest>(authenticator->getName(), authenticator->getResponse()));
}
void ClientSession::handleTLSEncrypted() {
if (!std::dynamic_pointer_cast<BOSHSessionStream>(stream)) {
- CHECK_STATE_OR_RETURN(State::Encrypting);
+ CHECK_STATE_OR_RETURN(State::Encrypting)
}
std::vector<Certificate::ref> certificateChain = stream->getPeerCertificateChain();
std::shared_ptr<CertificateVerificationError> verificationError = stream->getPeerCertificateVerificationError();
if (verificationError) {
checkTrustOrFinish(certificateChain, verificationError);