diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-23 13:51:45 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2015-08-23 13:51:45 +0300 |
commit | 9dcd333d8f7ac35cadffd03325a0f72933a0dcc7 (patch) | |
tree | 608536f2616e410cf1b69f1424b784f5d297d818 /server/src/modules_handler.cpp | |
parent | c77cb85e69a830d3b41ba1d55fdc7ff69d330491 (diff) |
server:
started first downloader module implementation
added api to get core settings
downloads_dir in config
Diffstat (limited to 'server/src/modules_handler.cpp')
-rw-r--r-- | server/src/modules_handler.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/src/modules_handler.cpp b/server/src/modules_handler.cpp index 65148ef..78a6ad7 100644 --- a/server/src/modules_handler.cpp +++ b/server/src/modules_handler.cpp @@ -49,7 +49,7 @@ void modules_handler::load_metadata_modules(const std::string &path) if(!lib) { printf("failed to open library \"%s\" with error: %s\n", i->path().c_str(), dlerror()); - return; + continue; } void *fptr = dlsym(lib, "udm_metadata_module_load"); @@ -57,7 +57,7 @@ void modules_handler::load_metadata_modules(const std::string &path) { printf("failed to find symbol \"udm_metadata_module_load\" in library %s with error %s\n", i->path().c_str(), dlerror()); dlclose(lib); - return; + continue; } module_metadata_storage *(*f)(void); f = (module_metadata_storage *(*)(void))fptr; @@ -76,18 +76,18 @@ void modules_handler::load_downloader_modules(const std::string &path) { for(boost::filesystem::directory_iterator i(path), end = boost::filesystem::directory_iterator(); i != end; ++i) { - void *lib = dlopen(i->path().generic_string().c_str(), RTLD_LAZY); + void *lib = dlopen(i->path().generic_string().c_str(), RTLD_LAZY |RTLD_GLOBAL); if(!lib) { printf("failed to open library \"%s\" with error: %s\n", i->path().c_str(), dlerror()); - return; + continue; } void *fptr = dlsym(lib, "udm_downloader_module_load"); if(!fptr) { printf("failed to find symbol \"udm_downloader_module_load\" in library %s with error %s\n", i->path().c_str(), dlerror()); dlclose(lib); - return; + continue; } module_downloader *(*f)(void); f = (module_downloader *(*)(void))fptr; @@ -169,9 +169,9 @@ void modules_handler::load_modules() load_metadata_modules(self_dir + "/modules/metadata"); load_metadata_modules(replace_home_var("~/.share/udm/modules/metadata")); load_metadata_modules("/usr/lib/udm/modules/metadata"); - load_downloader_modules(self_dir + "/modules/downloader"); - load_downloader_modules(replace_home_var("~/.share/udm/modules/downloader")); - load_downloader_modules("/usr/lib/udm/modules/downloader"); + load_downloader_modules(self_dir + "/modules/downloaders"); + load_downloader_modules(replace_home_var("~/.share/udm/modules/downloaders")); + load_downloader_modules("/usr/lib/udm/modules/downloaders"); load_modules_settings(); } |