summaryrefslogtreecommitdiff
path: root/server/include
diff options
context:
space:
mode:
Diffstat (limited to 'server/include')
-rw-r--r--server/include/download_internal.h31
-rw-r--r--server/include/modules_handler.h2
-rw-r--r--server/include/server.h4
-rw-r--r--server/include/server_session.h4
4 files changed, 39 insertions, 2 deletions
diff --git a/server/include/download_internal.h b/server/include/download_internal.h
new file mode 100644
index 0000000..3474071
--- /dev/null
+++ b/server/include/download_internal.h
@@ -0,0 +1,31 @@
+/*
+ Copyright © 2015 Gluzskiy Alexandr (sss)
+
+ This file is part of Unknown Download Manager (UDM).
+
+ UDM is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ UDM is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with UDM. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#ifndef DOWNLOAD_INTERNAL_H
+#define DOWNLOAD_INTERNAL_H
+
+struct download_internal_s
+{
+ int core_id, module_id;
+ std::string module_name;
+};
+
+
+#endif
diff --git a/server/include/modules_handler.h b/server/include/modules_handler.h
index 5696053..7c8bc71 100644
--- a/server/include/modules_handler.h
+++ b/server/include/modules_handler.h
@@ -24,6 +24,7 @@
#include <api_module_metadata_storage.h>
#include <api_module_downloader.h>
+#include "download_internal.h"
#include <list>
class modules_handler
@@ -32,6 +33,7 @@ class modules_handler
modules_handler();
void load_modules();
void on_modules_loaded();
+ void sync_downloads(std::map<int, download_internal_s> &downloads);
std::string list_modules();
std::list<module_base*> &get_metadata_modules();
std::list<module_base*> &get_downloader_modules();
diff --git a/server/include/server.h b/server/include/server.h
index 699fb01..046628a 100644
--- a/server/include/server.h
+++ b/server/include/server.h
@@ -26,6 +26,7 @@
#include <boost/asio/ssl.hpp>
#include "config.h"
#include "client.h"
+#include "download_internal.h"
//TODO ssl
@@ -35,7 +36,7 @@ class server_session;
class server
{
public:
- server(boost::asio::io_service& io_service, runtime_config_s &config, std::map<std::string, client*> &clients, short port);
+ server(boost::asio::io_service& io_service, runtime_config_s &config, std::map<std::string, client*> &clients, std::map<int, download_internal_s> &downloads, short port);
private:
void start_accept();
@@ -46,6 +47,7 @@ private:
boost::asio::ssl::context *context_;
runtime_config_s &runtime_config;
std::map<std::string, client*> &clients;
+ std::map<int, download_internal_s> &downloads;
};
diff --git a/server/include/server_session.h b/server/include/server_session.h
index bad8f4f..01a8c4b 100644
--- a/server/include/server_session.h
+++ b/server/include/server_session.h
@@ -26,6 +26,7 @@
#include <boost/asio/ssl.hpp>
#include "config.h"
#include "client.h"
+#include "download_internal.h"
class client_msg;
class server_msg;
@@ -34,7 +35,7 @@ class socket_wraper;
class server_session
{
public:
- server_session(boost::asio::io_service &s, runtime_config_s &config, std::map<std::string, client*> &clients_, boost::asio::ssl::context *c = nullptr);
+ server_session(boost::asio::io_service &s, runtime_config_s &config, std::map<std::string, client*> &clients_, std::map<int, download_internal_s> &downloads, boost::asio::ssl::context *c = nullptr);
void run();
void send_message(server_msg *msg);
socket_wraper* socket();
@@ -55,6 +56,7 @@ class server_session
runtime_config_s &runtime_config;
std::map<std::string, client*> &clients;
client *client_;
+ std::map<int, download_internal_s> &downloads;
//TODO: store client ptr
};