diff options
| author | Remko Tronçon <git@el-tramo.be> | 2009-11-25 19:19:28 (GMT) |
|---|---|---|
| committer | Remko Tronçon <git@el-tramo.be> | 2009-11-25 19:20:53 (GMT) |
| commit | db00adc9810377500e6ab27900b29496a0d05afe (patch) | |
| tree | 0f13d821883e0e99e9b6e7f15c84e3371375cd96 /Swiften/Client/ClientSession.h | |
| parent | c198064db0a6444a24220eee65cbf747eb7fbfb0 (diff) | |
| download | swift-db00adc9810377500e6ab27900b29496a0d05afe.zip swift-db00adc9810377500e6ab27900b29496a0d05afe.tar.bz2 | |
Enabled stream compression again.
Diffstat (limited to 'Swiften/Client/ClientSession.h')
| -rw-r--r-- | Swiften/Client/ClientSession.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Swiften/Client/ClientSession.h b/Swiften/Client/ClientSession.h index 5e5acbc..ef4d747 100644 --- a/Swiften/Client/ClientSession.h +++ b/Swiften/Client/ClientSession.h @@ -1,84 +1,85 @@ #pragma once #include <boost/signal.hpp> #include <boost/shared_ptr.hpp> #include <boost/enable_shared_from_this.hpp> #include "Swiften/Base/Error.h" #include "Swiften/Session/SessionStream.h" #include "Swiften/Session/BasicSessionStream.h" #include "Swiften/Base/String.h" #include "Swiften/JID/JID.h" #include "Swiften/Elements/Element.h" namespace Swift { class ClientAuthenticator; class ClientSession : public boost::enable_shared_from_this<ClientSession> { public: enum State { Initial, WaitingForStreamStart, Negotiating, Compressing, WaitingForEncrypt, Encrypting, WaitingForCredentials, Authenticating, BindingResource, StartingSession, Initialized, Finished }; struct Error : public Swift::Error { enum Type { AuthenticationFailedError, + CompressionFailedError, ServerVerificationFailedError, NoSupportedAuthMechanismsError, UnexpectedElementError, ResourceBindError, SessionStartError, TLSClientCertificateError, TLSError, } type; Error(Type type) : type(type) {} }; static boost::shared_ptr<ClientSession> create(const JID& jid, boost::shared_ptr<SessionStream> stream) { return boost::shared_ptr<ClientSession>(new ClientSession(jid, stream)); } State getState() const { return state; } void start(); void finish(); void sendCredentials(const String& password); void sendElement(boost::shared_ptr<Element> element); public: boost::signal<void ()> onNeedCredentials; boost::signal<void ()> onInitialized; boost::signal<void (boost::shared_ptr<Swift::Error>)> onFinished; boost::signal<void (boost::shared_ptr<Element>)> onElementReceived; private: ClientSession( const JID& jid, boost::shared_ptr<SessionStream>); void finishSession(Error::Type error); void finishSession(boost::shared_ptr<Swift::Error> error); JID getRemoteJID() const { return JID("", localJID.getDomain()); } void sendStreamHeader(); void sendSessionStart(); void handleElement(boost::shared_ptr<Element>); void handleStreamStart(const ProtocolHeader&); |
Swift