summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-18 19:04:32 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-18 20:40:56 (GMT)
commit4457bc810a326de8d7895b3f2ff36ade5f1ae1a0 (patch)
tree1556c4b0190453897d4799d23b05e651b0bb8a32 /Swiften/Server
parent4052a822acd9da9dab6a8e2343c6170fb08dd8d6 (diff)
downloadswift-4457bc810a326de8d7895b3f2ff36ade5f1ae1a0.zip
swift-4457bc810a326de8d7895b3f2ff36ade5f1ae1a0.tar.bz2
Implement incoming linklocal connections.
Diffstat (limited to 'Swiften/Server')
-rw-r--r--Swiften/Server/ServerFromClientSession.cpp12
-rw-r--r--Swiften/Server/ServerFromClientSession.h3
2 files changed, 10 insertions, 5 deletions
diff --git a/Swiften/Server/ServerFromClientSession.cpp b/Swiften/Server/ServerFromClientSession.cpp
index 9a3cf83..45df3be 100644
--- a/Swiften/Server/ServerFromClientSession.cpp
+++ b/Swiften/Server/ServerFromClientSession.cpp
@@ -2,6 +2,7 @@
#include <boost/bind.hpp>
+#include "Swiften/Elements/ProtocolHeader.h"
#include "Swiften/Server/UserRegistry.h"
#include "Swiften/Network/Connection.h"
#include "Swiften/StreamStack/StreamStack.h"
@@ -42,7 +43,7 @@ ServerFromClientSession::~ServerFromClientSession() {
void ServerFromClientSession::start() {
xmppLayer_->onStreamStart.connect(
- boost::bind(&ServerFromClientSession::handleStreamStart, this, _2));
+ boost::bind(&ServerFromClientSession::handleStreamStart, this, _1));
xmppLayer_->onElement.connect(
boost::bind(&ServerFromClientSession::handleElement, this, _1));
//xmppLayer_->onError.connect(
@@ -99,9 +100,12 @@ void ServerFromClientSession::handleElement(boost::shared_ptr<Element> element)
}
}
-void ServerFromClientSession::handleStreamStart(const String& domain) {
- domain_ = JID("", domain);
- xmppLayer_->writeHeader(domain, id_);
+void ServerFromClientSession::handleStreamStart(const ProtocolHeader& incomingHeader) {
+ domain_ = JID("", incomingHeader.getTo());
+ ProtocolHeader header;
+ header.setFrom(incomingHeader.getTo());
+ header.setID(id_);
+ xmppLayer_->writeHeader(header);
boost::shared_ptr<StreamFeatures> features(new StreamFeatures());
if (!authenticated_) {
diff --git a/Swiften/Server/ServerFromClientSession.h b/Swiften/Server/ServerFromClientSession.h
index e7df99d..733c428 100644
--- a/Swiften/Server/ServerFromClientSession.h
+++ b/Swiften/Server/ServerFromClientSession.h
@@ -9,6 +9,7 @@
#include "Swiften/Network/Connection.h"
namespace Swift {
+ class ProtocolHeader;
class Element;
class Stanza;
class PayloadParserFactoryCollection;
@@ -51,7 +52,7 @@ namespace Swift {
private:
void handleDisconnected(const boost::optional<Connection::Error>& error);
void handleElement(boost::shared_ptr<Element>);
- void handleStreamStart(const String& domain);
+ void handleStreamStart(const ProtocolHeader& header);
private:
String id_;