spectrum2/include/Swiften/Network/DummyConnectionServer.cpp
Vladimír Matěna 0729d364ca Fix double free in DummyConnectionServer
Do not create shared ptr from this as this lead to double free in
UserRegistryTest::login test. Shared ptr was needed to set event
owner in acceptConnection, actually it is never needed as events
are never filtered by owner. Thus it was removed and there is no
need to create shared ptr from this.
2016-09-17 00:45:34 +03:00

42 lines
948 B
C++

/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include <Swiften/Network/DummyConnectionServer.h>
#include <boost/signal.hpp>
#include <boost/bind.hpp>
#include <boost/system/system_error.hpp>
#include <boost/asio/placeholders.hpp>
#include <Swiften/EventLoop/EventLoop.h>
#include "Swiften/SwiftenCompat.h"
namespace Swift {
DummyConnectionServer::DummyConnectionServer(EventLoop* eventLoop) : eventLoop(eventLoop) {
}
void DummyConnectionServer::start() {
}
void DummyConnectionServer::stop() {
}
void DummyConnectionServer::acceptConnection(SWIFTEN_SHRPTR_NAMESPACE::shared_ptr<Swift::Connection> connection) {
eventLoop->postEvent(
boost::bind(boost::ref(onNewConnection), connection));
// connection->listen();
}
HostAddressPort DummyConnectionServer::getAddressPort() const {
return HostAddressPort();
}
}