diff options
Diffstat (limited to 'Swiften/Session/BOSHSessionStream.h')
-rw-r--r-- | Swiften/Session/BOSHSessionStream.h | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/Swiften/Session/BOSHSessionStream.h b/Swiften/Session/BOSHSessionStream.h index 66e41ea..0c26848 100644 --- a/Swiften/Session/BOSHSessionStream.h +++ b/Swiften/Session/BOSHSessionStream.h @@ -1,12 +1,12 @@ /* - * Copyright (c) 2011-2015 Isode Limited. + * Copyright (c) 2011-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> #include <Swiften/Base/API.h> #include <Swiften/Base/SafeByteArray.h> @@ -18,85 +18,85 @@ #include <Swiften/TLS/TLSOptions.h> namespace Swift { - class CompressionLayer; - class ConnectionLayer; - class EventLoop; - class HTTPTrafficFilter; - class PayloadParserFactoryCollection; - class PayloadSerializerCollection; - class StreamStack; - class TLSContextFactory; - class TimerFactory; - class XMLParserFactory; - class XMPPLayer; + class CompressionLayer; + class ConnectionLayer; + class EventLoop; + class HTTPTrafficFilter; + class PayloadParserFactoryCollection; + class PayloadSerializerCollection; + class StreamStack; + class TLSContextFactory; + class TimerFactory; + class XMLParserFactory; + class XMPPLayer; - class SWIFTEN_API BOSHSessionStream : public SessionStream, public EventOwner, public boost::enable_shared_from_this<BOSHSessionStream> { - public: - BOSHSessionStream( - const URL& boshURL, - PayloadParserFactoryCollection* payloadParserFactories, - PayloadSerializerCollection* payloadSerializers, - ConnectionFactory* connectionFactory, - TLSContextFactory* tlsContextFactory, - TimerFactory* whitespacePingLayerFactory, - XMLParserFactory* xmlParserFactory, - EventLoop* eventLoop, - DomainNameResolver* resolver, - const std::string& to, - const URL& boshHTTPConnectProxyURL, - const SafeString& boshHTTPConnectProxyAuthID, - const SafeString& boshHTTPConnectProxyAuthPassword, - const TLSOptions& tlsOptions, - boost::shared_ptr<HTTPTrafficFilter> trafficFilter - ); - virtual ~BOSHSessionStream(); + class SWIFTEN_API BOSHSessionStream : public SessionStream, public EventOwner, public std::enable_shared_from_this<BOSHSessionStream> { + public: + BOSHSessionStream( + const URL& boshURL, + PayloadParserFactoryCollection* payloadParserFactories, + PayloadSerializerCollection* payloadSerializers, + ConnectionFactory* connectionFactory, + TLSContextFactory* tlsContextFactory, + TimerFactory* whitespacePingLayerFactory, + XMLParserFactory* xmlParserFactory, + EventLoop* eventLoop, + DomainNameResolver* resolver, + const std::string& to, + const URL& boshHTTPConnectProxyURL, + const SafeString& boshHTTPConnectProxyAuthID, + const SafeString& boshHTTPConnectProxyAuthPassword, + const TLSOptions& tlsOptions, + std::shared_ptr<HTTPTrafficFilter> trafficFilter + ); + virtual ~BOSHSessionStream(); - void open(); - virtual void close(); - virtual bool isOpen(); + void open(); + virtual void close(); + virtual bool isOpen(); - virtual void writeHeader(const ProtocolHeader& header); - virtual void writeElement(boost::shared_ptr<ToplevelElement>); - virtual void writeFooter(); - virtual void writeData(const std::string& data); + virtual void writeHeader(const ProtocolHeader& header); + virtual void writeElement(std::shared_ptr<ToplevelElement>); + virtual void writeFooter(); + virtual void writeData(const std::string& data); - virtual bool supportsZLibCompression(); - virtual void addZLibCompression(); + virtual bool supportsZLibCompression(); + virtual void addZLibCompression(); - virtual bool supportsTLSEncryption(); - virtual void addTLSEncryption(); - virtual bool isTLSEncrypted(); - virtual Certificate::ref getPeerCertificate() const; - virtual std::vector<Certificate::ref> getPeerCertificateChain() const; - virtual boost::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const; - virtual ByteArray getTLSFinishMessage() const; + virtual bool supportsTLSEncryption(); + virtual void addTLSEncryption(); + virtual bool isTLSEncrypted(); + virtual Certificate::ref getPeerCertificate() const; + virtual std::vector<Certificate::ref> getPeerCertificateChain() const; + virtual std::shared_ptr<CertificateVerificationError> getPeerCertificateVerificationError() const; + virtual ByteArray getTLSFinishMessage() const; - virtual void setWhitespacePingEnabled(bool); + virtual void setWhitespacePingEnabled(bool); - virtual void resetXMPPParser(); + virtual void resetXMPPParser(); - private: - void handleXMPPError(); - void handleStreamStartReceived(const ProtocolHeader&); - void handleElementReceived(boost::shared_ptr<ToplevelElement>); - void handlePoolXMPPDataRead(const SafeByteArray& data); - void handleXMPPLayerDataWritten(const SafeByteArray& data); - void handlePoolSessionStarted(); - void handlePoolBOSHDataRead(const SafeByteArray& data); - void handlePoolBOSHDataWritten(const SafeByteArray& data); - void handlePoolSessionTerminated(BOSHError::ref condition); + private: + void handleXMPPError(); + void handleStreamStartReceived(const ProtocolHeader&); + void handleElementReceived(std::shared_ptr<ToplevelElement>); + void handlePoolXMPPDataRead(const SafeByteArray& data); + void handleXMPPLayerDataWritten(const SafeByteArray& data); + void handlePoolSessionStarted(); + void handlePoolBOSHDataRead(const SafeByteArray& data); + void handlePoolBOSHDataWritten(const SafeByteArray& data); + void handlePoolSessionTerminated(BOSHError::ref condition); - private: - void fakeStreamHeaderReceipt(); - void fakeStreamFooterReceipt(BOSHError::ref error); + private: + void fakeStreamHeaderReceipt(); + void fakeStreamFooterReceipt(BOSHError::ref error); - private: - BOSHConnectionPool* connectionPool; - bool available; - XMPPLayer* xmppLayer; - ProtocolHeader streamHeader; - EventLoop* eventLoop; - bool firstHeader; - }; + private: + BOSHConnectionPool* connectionPool; + bool available; + XMPPLayer* xmppLayer; + ProtocolHeader streamHeader; + EventLoop* eventLoop; + bool firstHeader; + }; } |