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
+4 -6
View File
@@ -7,7 +7,6 @@
#include <log/LogUtils.h>
#include <random>
#include "./LocalFileProvider.h"
#include "LocalFileProvider.h"
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
@@ -42,12 +41,13 @@ FileClient::~FileClient() {
assert(!this->networking.event_write);
assert(this->state == STATE_DISCONNECTED);
memtrack::freed<FileClient>(this);
}
LocalFileTransfer::LocalFileTransfer(filesystem::LocalFileSystem &fs) : file_system_{fs} {}
LocalFileTransfer::~LocalFileTransfer() = default;
bool LocalFileTransfer::start(const std::deque<std::shared_ptr<NetworkBinding>>& bindings) {
bool LocalFileTransfer::start() {
(void) this->start_client_worker();
{
@@ -66,17 +66,15 @@ bool LocalFileTransfer::start(const std::deque<std::shared_ptr<NetworkBinding>>&
{
this->network.bindings = bindings;
auto start_result = this->start_networking();
switch (start_result) {
case NetworkingStartResult::SUCCESS:
break;
case NetworkingStartResult::OUT_OF_MEMORY:
logError(LOG_FT, "Failed to start networking (Out of memory)");
goto error_exit_network;
case NetworkingStartResult::NO_BINDINGS:
logError(LOG_FT, "Failed to start networking (No address could be bound)");
goto error_exit_network;
default:
logError(LOG_FT, "Failed to start networking ({})", (int) start_result);
goto error_exit_network;