diff options
Diffstat (limited to 'Slimber')
-rw-r--r-- | Slimber/Server.cpp | 6 | ||||
-rw-r--r-- | Slimber/Server.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/Slimber/Server.cpp b/Slimber/Server.cpp index 84b33fa..769217f 100644 --- a/Slimber/Server.cpp +++ b/Slimber/Server.cpp @@ -141,19 +141,19 @@ void Server::stop(boost::optional<ServerError> e) { onStopped(e); } void Server::handleNewClientConnection(boost::shared_ptr<Connection> connection) { if (serverFromClientSession) { connection->disconnect(); } serverFromClientSession = boost::shared_ptr<ServerFromClientSession>( new ServerFromClientSession(idGenerator.generateID(), connection, - &payloadParserFactories, &payloadSerializers, &userRegistry)); + &payloadParserFactories, &payloadSerializers, &xmlParserFactory, &userRegistry)); serverFromClientSession->setAllowSASLEXTERNAL(); serverFromClientSession->onSessionStarted.connect( boost::bind(&Server::handleSessionStarted, this)); serverFromClientSession->onElementReceived.connect( boost::bind(&Server::handleElementReceived, this, _1, serverFromClientSession)); serverFromClientSession->onSessionFinished.connect( boost::bind(&Server::handleSessionFinished, this, serverFromClientSession)); @@ -275,19 +275,19 @@ void Server::handleElementReceived(boost::shared_ptr<Element> element, boost::sh } } } } void Server::handleNewLinkLocalConnection(boost::shared_ptr<Connection> connection) { boost::shared_ptr<IncomingLinkLocalSession> session( new IncomingLinkLocalSession( selfJID, connection, - &payloadParserFactories, &payloadSerializers)); + &payloadParserFactories, &payloadSerializers, &xmlParserFactory)); registerLinkLocalSession(session); } void Server::handleLinkLocalSessionFinished(boost::shared_ptr<Session> session) { //std::cout << "Link local session from " << session->getRemoteJID() << " ended" << std::endl; linkLocalSessions.erase( std::remove(linkLocalSessions.begin(), linkLocalSessions.end(), session), linkLocalSessions.end()); } @@ -306,19 +306,19 @@ void Server::handleLinkLocalElementReceived(boost::shared_ptr<Element> element, void Server::handleConnectFinished(boost::shared_ptr<LinkLocalConnector> connector, bool error) { if (error) { std::cerr << "Error connecting" << std::endl; // TODO: Send back queued stanzas } else { boost::shared_ptr<OutgoingLinkLocalSession> outgoingSession( new OutgoingLinkLocalSession( selfJID, connector->getService().getJID(), connector->getConnection(), - &payloadParserFactories, &payloadSerializers)); + &payloadParserFactories, &payloadSerializers, &xmlParserFactory)); foreach(const boost::shared_ptr<Element> element, connector->getQueuedElements()) { outgoingSession->queueElement(element); } registerLinkLocalSession(outgoingSession); } connectors.erase(std::remove(connectors.begin(), connectors.end(), connector), connectors.end()); } void Server::registerLinkLocalSession(boost::shared_ptr<Session> session) { diff --git a/Slimber/Server.h b/Slimber/Server.h index 58b1e7c..96401d9 100644 --- a/Slimber/Server.h +++ b/Slimber/Server.h @@ -8,18 +8,19 @@ #include <boost/shared_ptr.hpp> #include <boost/optional.hpp> #include <vector> #include "Swiften/Network/BoostIOServiceThread.h" #include "Swiften/Network/BoostConnectionServer.h" #include "Limber/Server/UserRegistry.h" #include "Swiften/Base/IDGenerator.h" +#include "Swiften/Parser/PlatformXMLParserFactory.h" #include "Limber/Server/ServerFromClientSession.h" #include "Swiften/JID/JID.h" #include "Swiften/Parser/PayloadParsers/FullPayloadParserFactoryCollection.h" #include "Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h" #include "Swiften/LinkLocal/LinkLocalServiceInfo.h" #include "Slimber/ServerError.h" namespace Swift { class DNSSDServiceID; @@ -92,18 +93,19 @@ namespace Swift { } }; private: IDGenerator idGenerator; FullPayloadParserFactoryCollection payloadParserFactories; FullPayloadSerializerCollection payloadSerializers; BoostIOServiceThread boostIOServiceThread; DummyUserRegistry userRegistry; + PlatformXMLParserFactory xmlParserFactory; bool linkLocalServiceRegistered; bool rosterRequested; int clientConnectionPort; int linkLocalConnectionPort; LinkLocalServiceBrowser* linkLocalServiceBrowser; VCardCollection* vCardCollection; EventLoop* eventLoop; LinkLocalPresenceManager* presenceManager; bool stopping; |