summaryrefslogtreecommitdiff
path: root/server/include
diff options
context:
space:
mode:
Diffstat (limited to 'server/include')
-rw-r--r--server/include/api_module_downloader.h4
-rw-r--r--server/include/download_internal.h2
-rw-r--r--server/include/server.h4
3 files changed, 7 insertions, 3 deletions
diff --git a/server/include/api_module_downloader.h b/server/include/api_module_downloader.h
index 33a3fce..9e42715 100644
--- a/server/include/api_module_downloader.h
+++ b/server/include/api_module_downloader.h
@@ -83,14 +83,14 @@ struct download_s {
int64_t size, downloaded, download_speed; //download size and size of downloaded data, also download speed all vars in bytes
std::map<int, std::string> info_map; //any additional info provided by downloader module can be stored here
std::list<download_content_entry_s> content; //download content can be set for download, structure described above
- std::map<std::string, std::string> metadata;
+ std::map<std::string, std::string> metadata; //client defined metadata map
};
class module_downloader : public module_base
{
public:
//basic actions
- virtual int add_download(std::map<int, std::string> params) = 0; //add download, this function must return unique for current session and current downloader download id
+ virtual int add_download(std::map<int, std::string> params) = 0; //add download, this function must return unique for current session and current downloader download id, -1 on error
virtual bool stop_download(int download_id) = 0; //stop download by id received via add_download, return true on success, false otherwise
virtual bool start_download(int download_id) = 0; //start download by id received via add_download, return true on success, false otherwise
virtual bool delete_download(int download_id, bool delete_data = false) = 0; //delete download by id received via add_download, if "delete_data" is set, also remove all downloaded data from storage, return true on success, false otherwise
diff --git a/server/include/download_internal.h b/server/include/download_internal.h
index 3474071..60d9608 100644
--- a/server/include/download_internal.h
+++ b/server/include/download_internal.h
@@ -23,7 +23,7 @@
struct download_internal_s
{
- int core_id, module_id;
+ int module_id;
std::string module_name;
};
diff --git a/server/include/server.h b/server/include/server.h
index 046628a..812406a 100644
--- a/server/include/server.h
+++ b/server/include/server.h
@@ -37,6 +37,10 @@ class server
{
public:
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);
+ void terminate()
+ {
+ io_service_.stop();
+ }
private:
void start_accept();