diff options
Diffstat (limited to 'Swiften/Session')
-rw-r--r-- | Swiften/Session/BasicSessionStream.cpp | 6 | ||||
-rw-r--r-- | Swiften/Session/BasicSessionStream.h | 4 | ||||
-rw-r--r-- | Swiften/Session/SessionStream.h | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Swiften/Session/BasicSessionStream.cpp b/Swiften/Session/BasicSessionStream.cpp index 0d0f49f..ed7f1eb 100644 --- a/Swiften/Session/BasicSessionStream.cpp +++ b/Swiften/Session/BasicSessionStream.cpp @@ -6,6 +6,7 @@ #include "Swiften/StreamStack/StreamStack.h" #include "Swiften/StreamStack/ConnectionLayer.h" #include "Swiften/StreamStack/WhitespacePingLayer.h" +#include "Swiften/StreamStack/CompressionLayer.h" #include "Swiften/StreamStack/TLSLayer.h" #include "Swiften/StreamStack/TLSLayerFactory.h" @@ -74,6 +75,11 @@ void BasicSessionStream::addTLSEncryption() { } } +void BasicSessionStream::addZLibCompression() { + boost::shared_ptr<CompressionLayer> compressionLayer(new CompressionLayer()); + streamStack->addLayer(compressionLayer); +} + void BasicSessionStream::setWhitespacePingEnabled(bool enabled) { if (enabled) { if (!whitespacePingLayer) { diff --git a/Swiften/Session/BasicSessionStream.h b/Swiften/Session/BasicSessionStream.h index f36df83..8618458 100644 --- a/Swiften/Session/BasicSessionStream.h +++ b/Swiften/Session/BasicSessionStream.h @@ -16,6 +16,7 @@ namespace Swift { class StreamStack; class XMPPLayer; class ConnectionLayer; + class CompressionLayer; class BasicSessionStream : public SessionStream, @@ -38,6 +39,8 @@ namespace Swift { virtual void writeElement(boost::shared_ptr<Element>); virtual void writeFooter(); + virtual void addZLibCompression(); + virtual bool supportsTLSEncryption(); virtual void addTLSEncryption(); @@ -65,6 +68,7 @@ namespace Swift { boost::shared_ptr<XMPPLayer> xmppLayer; boost::shared_ptr<ConnectionLayer> connectionLayer; StreamStack* streamStack; + boost::shared_ptr<CompressionLayer> compressionLayer; boost::shared_ptr<TLSLayer> tlsLayer; boost::shared_ptr<WhitespacePingLayer> whitespacePingLayer; }; diff --git a/Swiften/Session/SessionStream.h b/Swiften/Session/SessionStream.h index 1252c5a..8c64ccf 100644 --- a/Swiften/Session/SessionStream.h +++ b/Swiften/Session/SessionStream.h @@ -34,6 +34,8 @@ namespace Swift { virtual void writeFooter() = 0; virtual void writeElement(boost::shared_ptr<Element>) = 0; + virtual void addZLibCompression() = 0; + virtual bool supportsTLSEncryption() = 0; virtual void addTLSEncryption() = 0; virtual void setWhitespacePingEnabled(bool enabled) = 0; |