diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-11-08 16:12:48 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-11-08 18:32:15 (GMT) |
commit | f1d74218cb432513c376b46aa115acb3e107ed3a (patch) | |
tree | 24df6a3233f1fd3c2c2592637cfcfd1846040dee /Swiften/Client | |
parent | b6003bea740e8898127ec135e230eed421924370 (diff) | |
download | swift-f1d74218cb432513c376b46aa115acb3e107ed3a.zip swift-f1d74218cb432513c376b46aa115acb3e107ed3a.tar.bz2 |
Added Error class.
Diffstat (limited to 'Swiften/Client')
-rw-r--r-- | Swiften/Client/Client.cpp | 5 | ||||
-rw-r--r-- | Swiften/Client/Client.h | 6 | ||||
-rw-r--r-- | Swiften/Client/UnitTest/ClientSessionTest.cpp | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp index 60dfade..b3bea0d 100644 --- a/Swiften/Client/Client.cpp +++ b/Swiften/Client/Client.cpp @@ -10,6 +10,7 @@ #include "Swiften/Network/BoostConnectionFactory.h" #include "Swiften/Network/DomainNameResolveException.h" #include "Swiften/TLS/PKCS12Certificate.h" +#include "Swiften/Session/BasicSessionStream.h" namespace Swift { @@ -46,6 +47,10 @@ void Client::handleConnectionConnectFinished(bool error) { onError(ClientError::ConnectionError); } else { + assert(!sessionStream_); + sessionStream_ = boost::shared_ptr<BasicSessionStream>(new BasicSessionStream(connection_, &payloadParserFactories_, &payloadSerializers_, tlsLayerFactory_)); + sessionStream_->initialize(); + session_ = boost::shared_ptr<ClientSession>(new ClientSession(jid_, connection_, tlsLayerFactory_, &payloadParserFactories_, &payloadSerializers_)); if (!certificate_.isEmpty()) { session_->setCertificate(PKCS12Certificate(certificate_, password_)); diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index 59e1c05..0e68f55 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -20,6 +20,7 @@ namespace Swift { class TLSLayerFactory; class ConnectionFactory; class ClientSession; + class BasicSessionStream; class Client : public StanzaChannel, public IQRouter, public boost::bsignals::trackable { public: @@ -53,6 +54,8 @@ namespace Swift { void handleDataRead(const ByteArray&); void handleDataWritten(const ByteArray&); + void reset(); + private: JID jid_; String password_; @@ -61,8 +64,9 @@ namespace Swift { TLSLayerFactory* tlsLayerFactory_; FullPayloadParserFactoryCollection payloadParserFactories_; FullPayloadSerializerCollection payloadSerializers_; - boost::shared_ptr<ClientSession> session_; boost::shared_ptr<Connection> connection_; + boost::shared_ptr<BasicSessionStream> sessionStream_; + boost::shared_ptr<ClientSession> session_; String certificate_; }; } diff --git a/Swiften/Client/UnitTest/ClientSessionTest.cpp b/Swiften/Client/UnitTest/ClientSessionTest.cpp index cbf20d2..70d4ba9 100644 --- a/Swiften/Client/UnitTest/ClientSessionTest.cpp +++ b/Swiften/Client/UnitTest/ClientSessionTest.cpp @@ -14,7 +14,7 @@ #include "Swiften/Elements/ProtocolHeader.h" #include "Swiften/Elements/StreamFeatures.h" #include "Swiften/Elements/Element.h" -#include "Swiften/Elements/Error.h" +#include "Swiften/Elements/ErrorPayload.h" #include "Swiften/Elements/IQ.h" #include "Swiften/Elements/AuthRequest.h" #include "Swiften/Elements/AuthSuccess.h" |