diff options
-rw-r--r-- | src/Common/RequestManager.cpp | 2 | ||||
-rw-r--r-- | src/Core/ConnectionManager.cpp | 15 | ||||
-rw-r--r-- | src/mad.cpp | 5 |
3 files changed, 20 insertions, 2 deletions
diff --git a/src/Common/RequestManager.cpp b/src/Common/RequestManager.cpp index 3dfd1cf..cc846c6 100644 --- a/src/Common/RequestManager.cpp +++ b/src/Common/RequestManager.cpp @@ -154,6 +154,8 @@ RequestManager::RequestManager() : core(false), requestId(-1) { } RequestManager::~RequestManager() { + unregisterPacketType(Net::Packet::DISCONNECT); + for(std::map<Net::Connection*,RequestMap*>::iterator it = requestMaps.begin(); it != requestMaps.end(); ++it) delete it->second; 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(); } diff --git a/src/mad.cpp b/src/mad.cpp index 4a4b405..83f01bb 100644 --- a/src/mad.cpp +++ b/src/mad.cpp @@ -87,6 +87,11 @@ int main() { delete connection; + Common::RequestManager::get()->unregisterPacketType(Net::Packet::FS_INFO); + Common::RequestManager::get()->unregisterPacketType(Net::Packet::STATUS); + Common::RequestManager::get()->unregisterPacketType(Net::Packet::COMMAND_REBOOT); + Common::RequestManager::get()->unregisterPacketType(Net::Packet::COMMAND_SHUTDOWN); + Common::Initializable::deinit(); Net::Connection::deinit(); |