summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-07-12 17:57:48 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-07-12 18:49:51 (GMT)
commit72858ab262a16aa8db209c2898ab0d3c951a9829 (patch)
tree411ccedbf9bdd746ccb1f124e74fe91111d63a56 /Swiften/StreamStack
parenteb1338be843c53aa02fac0d38455aada3f89db0b (diff)
downloadswift-72858ab262a16aa8db209c2898ab0d3c951a9829.zip
swift-72858ab262a16aa8db209c2898ab0d3c951a9829.tar.bz2
Added ServerFromClientSession.
Diffstat (limited to 'Swiften/StreamStack')
-rw-r--r--Swiften/StreamStack/IncomingConnectionLayer.h22
-rw-r--r--Swiften/StreamStack/XMPPLayer.cpp4
-rw-r--r--Swiften/StreamStack/XMPPLayer.h4
3 files changed, 26 insertions, 4 deletions
diff --git a/Swiften/StreamStack/IncomingConnectionLayer.h b/Swiften/StreamStack/IncomingConnectionLayer.h
new file mode 100644
index 0000000..c1a9eab
--- /dev/null
+++ b/Swiften/StreamStack/IncomingConnectionLayer.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <boost/signal.hpp>
+
+#include "Swiften/StreamStack/LowLayer.h"
+#include "Swiften/Network/IncomingConnection.h"
+
+namespace Swift {
+ class IncomingConnectionLayer : public LowLayer {
+ public:
+ IncomingConnectionLayer(IncomingConnection* connection) : connection_(connection) {
+ connection_->onDataRead.connect(onDataRead);
+ }
+
+ void writeData(const ByteArray& data) {
+ connection_->write(data);
+ }
+
+ private:
+ IncomingConnection* connection_;
+ };
+}
diff --git a/Swiften/StreamStack/XMPPLayer.cpp b/Swiften/StreamStack/XMPPLayer.cpp
index 7afa762..464d4b0 100644
--- a/Swiften/StreamStack/XMPPLayer.cpp
+++ b/Swiften/StreamStack/XMPPLayer.cpp
@@ -56,8 +56,8 @@ void XMPPLayer::doResetParser() {
resetParserAfterParse_ = false;
}
-void XMPPLayer::handleStreamStart() {
- onStreamStart();
+void XMPPLayer::handleStreamStart(const String& domain) {
+ onStreamStart(domain);
}
void XMPPLayer::handleElement(boost::shared_ptr<Element> stanza) {
diff --git a/Swiften/StreamStack/XMPPLayer.h b/Swiften/StreamStack/XMPPLayer.h
index 07b5b1c..e064d94 100644
--- a/Swiften/StreamStack/XMPPLayer.h
+++ b/Swiften/StreamStack/XMPPLayer.h
@@ -31,14 +31,14 @@ namespace Swift {
void resetParser();
public:
- boost::signal<void ()> onStreamStart;
+ boost::signal<void (const String& domain)> onStreamStart;
boost::signal<void (boost::shared_ptr<Element>)> onElement;
boost::signal<void (const ByteArray&)> onWriteData;
boost::signal<void (const ByteArray&)> onDataRead;
boost::signal<void ()> onError;
private:
- void handleStreamStart();
+ void handleStreamStart(const String&);
void handleElement(boost::shared_ptr<Element>);
void handleStreamEnd();