Some updates

This commit is contained in:
WolverinDEV
2020-05-14 15:08:28 +02:00
parent b987583770
commit c7751efa71
5 changed files with 30 additions and 2 deletions
@@ -569,6 +569,11 @@ command_result ConnectedClient::handleCommandFTInitUpload(ts::Command &cmd) {
std::shared_ptr<file::ExecuteResponse<file::transfer::TransferInitError, std::shared_ptr<file::transfer::Transfer>>> transfer_response{};
info.max_bandwidth = -1;
{
auto max_quota = this->calculate_permission(permission::i_ft_max_bandwidth_upload, this->getClientId());
if(max_quota.has_value)
info.max_bandwidth = max_quota.value;
}
info.file_offset = 0;
info.expected_file_size = cmd["size"].as<size_t>();
info.override_exiting = cmd["overwrite"].as<bool>();
@@ -721,6 +726,12 @@ command_result ConnectedClient::handleCommandFTInitDownload(ts::Command &cmd) {
}
info.max_bandwidth = -1;
{
auto max_quota = this->calculate_permission(permission::i_ft_max_bandwidth_download, this->getClientId());
if(max_quota.has_value)
info.max_bandwidth = max_quota.value;
}
info.file_offset = cmd["seekpos"].as<size_t>();
info.override_exiting = false;
info.file_path = cmd["name"].string();