summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-25 19:19:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-25 19:20:53 (GMT)
commitdb00adc9810377500e6ab27900b29496a0d05afe (patch)
tree0f13d821883e0e99e9b6e7f15c84e3371375cd96 /Swiften/Session
parentc198064db0a6444a24220eee65cbf747eb7fbfb0 (diff)
downloadswift-db00adc9810377500e6ab27900b29496a0d05afe.zip
swift-db00adc9810377500e6ab27900b29496a0d05afe.tar.bz2
Enabled stream compression again.
Diffstat (limited to 'Swiften/Session')
-rw-r--r--Swiften/Session/BasicSessionStream.cpp6
-rw-r--r--Swiften/Session/BasicSessionStream.h4
-rw-r--r--Swiften/Session/SessionStream.h2
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;