File transfer server now respects the port and host settings set via the config.yml

This commit is contained in:
WolverinDEV
2020-06-13 01:08:49 +02:00
parent ed7cbd38e8
commit a23002ce66
11 changed files with 263 additions and 122 deletions
+2 -8
View File
@@ -3,7 +3,6 @@
//
#include <files/FileServer.h>
#include <log/LogUtils.h>
#include <files/Config.h>
#include "./client/ConnectedClient.h"
@@ -15,15 +14,10 @@ using namespace ts::server::file;
FileServerHandler::FileServerHandler(ts::server::InstanceHandler *instance) : instance_{instance} {}
bool FileServerHandler::initialize(std::string &error) {
/*
* FIXME: Ports etc!
*
auto bindings_string = this->properties()[property::SERVERINSTANCE_FILETRANSFER_HOST].as<string>();
auto port = this->properties()[property::SERVERINSTANCE_FILETRANSFER_PORT].as<uint16_t>();
*/
if(!file::initialize(error))
if(!file::initialize(error, serverInstance->properties()[property::SERVERINSTANCE_FILETRANSFER_HOST].as<std::string>(), serverInstance->properties()[property::SERVERINSTANCE_FILETRANSFER_PORT].as<uint16_t>()))
return false;
file::config::ssl_option_supplier = [&]{
return this->instance_->sslManager()->web_ssl_options();
};