summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-13 07:17:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-13 07:18:39 (GMT)
commit6ca206b0d0645e50a8a2c59ebd134f9c0f164b9b (patch)
tree1c4d785f79941b07e7c7d7473fe98d09229b5fa6 /Swiften/Server
parent72858ab262a16aa8db209c2898ab0d3c951a9829 (diff)
downloadswift-contrib-6ca206b0d0645e50a8a2c59ebd134f9c0f164b9b.zip
swift-contrib-6ca206b0d0645e50a8a2c59ebd134f9c0f164b9b.tar.bz2
Server stream header support.
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp7
-rw-r--r--Swiften/Server/ServerFromClientSession.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index e85021e..be8b601 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -10,15 +10,17 @@
namespace Swift {
ServerFromClientSession::ServerFromClientSession(
+ const String& id,
boost::shared_ptr<IncomingConnection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers) :
+ id_(id),
connection_(connection),
payloadParserFactories_(payloadParserFactories),
payloadSerializers_(payloadSerializers) {
xmppLayer_ = new XMPPLayer(payloadParserFactories_, payloadSerializers_);
xmppLayer_->onStreamStart.connect(
- boost::bind(&ServerFromClientSession::handleStreamStart, this, _1));
+ boost::bind(&ServerFromClientSession::handleStreamStart, this, _2));
xmppLayer_->onElement.connect(
boost::bind(&ServerFromClientSession::handleElement, this, _1));
//xmppLayer_->onError.connect(
@@ -41,7 +43,8 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element>) {
}
void ServerFromClientSession::handleStreamStart(const String& domain) {
- xmppLayer_->writeHeader(domain);
+ domain_ = domain;
+ xmppLayer_->writeHeader(domain_, id_);
}
}
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index cedfcdb..3413a03 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -3,6 +3,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/signal.hpp>
+#include "Swiften/Base/String.h"
+
namespace Swift {
class Element;
class PayloadParserFactoryCollection;
@@ -12,11 +14,11 @@ namespace Swift {
class IncomingConnectionLayer;
class IncomingConnection;
class ByteArray;
- class String;
class ServerFromClientSession {
public:
ServerFromClientSession(
+ const String& id,
boost::shared_ptr<IncomingConnection> connection,
PayloadParserFactoryCollection* payloadParserFactories,
PayloadSerializerCollection* payloadSerializers);
@@ -31,11 +33,13 @@ namespace Swift {
void handleStreamStart(const String& domain);
private:
+ String id_;
boost::shared_ptr<IncomingConnection> connection_;
PayloadParserFactoryCollection* payloadParserFactories_;
PayloadSerializerCollection* payloadSerializers_;
IncomingConnectionLayer* connectionLayer_;
StreamStack* streamStack_;
XMPPLayer* xmppLayer_;
+ String domain_;
};
}