summaryrefslogtreecommitdiffstats
path: root/src/Core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core')
-rw-r--r--src/Core/ConnectionManager.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Core/ConnectionManager.cpp b/src/Core/ConnectionManager.cpp
index 833e2e6..63b29e1 100644
--- a/src/Core/ConnectionManager.cpp
+++ b/src/Core/ConnectionManager.cpp
@@ -132,6 +132,8 @@ void ConnectionManager::configFinished() {
ConnectionManager::ConnectionManager() {
Common::RequestManager::get()->setCore(true);
+ Net::Connection::init();
+
Common::RequestManager::get()->registerPacketType<Common::RequestHandlers::FSInfoRequestHandler>(Net::Packet::FS_INFO);
Common::RequestManager::get()->registerPacketType<Common::RequestHandlers::StatusRequestHandler>(Net::Packet::STATUS);
Common::RequestManager::get()->registerPacketType<RequestHandlers::DaemonCommandRequestHandler>(Net::Packet::DAEMON_COMMAND_REBOOT);
@@ -142,8 +144,6 @@ ConnectionManager::ConnectionManager() {
Common::RequestManager::get()->registerPacketType<RequestHandlers::GSSAPIAuthRequestHandler>(Net::Packet::GSSAPI_AUTH);
Common::RequestManager::get()->registerPacketType<RequestHandlers::IdentifyRequestHandler>(Net::Packet::IDENTIFY);
Common::RequestManager::get()->registerPacketType<RequestHandlers::LogRequestHandler>(Net::Packet::LOG);
-
- Net::Connection::init();
}
ConnectionManager::~ConnectionManager() {
@@ -153,6 +153,17 @@ ConnectionManager::~ConnectionManager() {
for(std::list<Net::ServerConnection*>::iterator con = clientConnections.begin(); con != clientConnections.end(); ++con)
delete *con;
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::FS_INFO);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::STATUS);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_COMMAND_REBOOT);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_COMMAND_SHUTDOWN);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_FS_INFO);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::LIST_DAEMONS);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::DAEMON_STATUS);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::GSSAPI_AUTH);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::IDENTIFY);
+ Common::RequestManager::get()->unregisterPacketType(Net::Packet::LOG);
+
Net::Connection::deinit();
}