Compare commits
10 Commits
eaa95cf9d1
...
v2.1.0-rc-
Author | SHA1 | Date | |
---|---|---|---|
4cf339cfc4 | |||
6fe23f270a | |||
c85fe76a48 | |||
4508b6d908 | |||
c74a70ce13 | |||
f5e88e44bf | |||
f11f92ba55 | |||
14d0173bd3 | |||
5b56c73528 | |||
87d336141c |
@@ -17,6 +17,7 @@ bugprone
|
||||
cflags
|
||||
chrono
|
||||
cmake_current_source_dir
|
||||
coinit_apartmentthreaded
|
||||
comdlg32
|
||||
cppcoreguidelines
|
||||
cppdbg
|
||||
@@ -27,6 +28,7 @@ cppvsdbg
|
||||
create_notraverse
|
||||
crypto_aead_xchacha20poly1305_ietf_npubbytes
|
||||
cstdint
|
||||
curle_couldnt_resolve_host
|
||||
curlopt_aws_sigv4
|
||||
cxxflags
|
||||
cxxstd
|
||||
@@ -199,6 +201,7 @@ secp256k1
|
||||
secur32
|
||||
sfml_project
|
||||
shlwapi
|
||||
sigchld
|
||||
skynet
|
||||
source_subdir
|
||||
spdlog
|
||||
|
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,13 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
## v2.1.0-rc
|
||||
|
||||
### Issues
|
||||
|
||||
### Changes from v2.0.6-release
|
||||
|
||||
* Fixed `.` and `..` incorrectly being reported as files in remote Linux mounts
|
||||
|
||||
## v2.0.6-release
|
||||
|
||||
### Issues
|
||||
|
||||
* ~~\#12 [Unit Test] Complete all providers unit tests~~
|
||||
* ~~\#21 [Unit Test] Complete WinFSP unit tests~~
|
||||
* ~~\#22 [Unit Test] Complete FUSE unit tests~~
|
||||
* ~~\#33 Complete initial v2.0 documentation~~
|
||||
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
|
||||
* \#43 [bug] Directories are not importing properly for Sia
|
||||
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
|
||||
@@ -19,9 +22,13 @@
|
||||
|
||||
### Changes from v2.0.5-rc
|
||||
|
||||
* Added request retry on `libcurl` error code `CURLE_COULDNT_RESOLVE_HOST`
|
||||
* Added `libcurl` DNS caching
|
||||
* Drive letters in UI should always be lowercase
|
||||
* Fixed WinFSP directory rename for non-empty directories
|
||||
* Fixed segfault in UI due to incorrect `SIGCHLD` handling
|
||||
* Migrated to v2 error handling
|
||||
* Upgraded WinFSP to v2.1 (2025)
|
||||
|
||||
## v2.0.5-rc
|
||||
|
||||
|
@@ -48,7 +48,7 @@ on Windows.
|
||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v2.0.0+ for Sia support
|
||||
* Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
||||
* Windows requires the following dependencies to be installed:
|
||||
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
||||
* [WinFSP 2025](https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi)
|
||||
|
||||
### Supported Operating Systems
|
||||
|
||||
@@ -453,7 +453,7 @@ in the `dist/` directory
|
||||
* [spdlog](https://github.com/gabime/spdlog)
|
||||
* [SQLite](https://www.sqlite.org)
|
||||
* [stduuid](https://github.com/mariusbancila/stduuid)
|
||||
* [Storj](https://storj.io/)
|
||||
* [Storj](https://www.storj.io/)
|
||||
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
|
||||
* [zlib](https://zlib.net/)
|
||||
|
||||
|
@@ -1,20 +1,20 @@
|
||||
set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
|
||||
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
||||
set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
|
||||
set(CPP_HTTPLIB_HASH 18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866)
|
||||
set(CURL_HASH ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699)
|
||||
set(CPP_HTTPLIB_HASH 410a1347ed6bcbcc4a19af8ed8ad3873fe9fa97731d52db845c4c78f3f9c31e6)
|
||||
set(CURL_HASH 2937cadde007aa3a52a17c21ac9153ea054700f37926d1d96602bf07e888c847)
|
||||
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
|
||||
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
|
||||
set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399)
|
||||
set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
|
||||
set(GTEST_HASH 65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c)
|
||||
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
||||
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
|
||||
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
||||
set(MINGW_HASH cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f)
|
||||
set(OPENSSL_HASH 344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0)
|
||||
set(MINGW_HASH 5afe822af5c4edbf67daaf45eec61d538f49eef6b19524de64897c6b95828caf)
|
||||
set(OPENSSL_HASH 529043b15cffa5f36077a4d0af83f3de399807181d607441d734196d889b641f)
|
||||
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
|
||||
set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
|
||||
set(ROCKSDB_HASH 3fdc9ca996971c4c039959866382c4a3a6c8ade4abf888f3b2ff77153e07bf28)
|
||||
set(SPDLOG_HASH 7a80896357f3e8e920e85e92633b14ba0f229c506e6f978578bdc35ba09e9a5d)
|
||||
set(SQLITE_HASH 6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3)
|
||||
set(ROCKSDB_HASH afccfab496556904900afacf7d99887f1d50cb893e5d2288bd502db233adacac)
|
||||
set(SPDLOG_HASH 15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
|
||||
set(SQLITE_HASH 9ad6d16cbc1df7cd55c8b55127c82a9bca5e9f287818de6dc87e04e73599d754)
|
||||
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
||||
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
||||
|
@@ -2,9 +2,9 @@ if(PROJECT_ENABLE_WINFSP AND PROJECT_IS_MINGW)
|
||||
if(PROJECT_BUILD)
|
||||
add_definitions(-DPROJECT_ENABLE_WINFSP)
|
||||
|
||||
include_directories(BEFORE SYSTEM ${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/inc)
|
||||
include_directories(BEFORE SYSTEM ${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/inc)
|
||||
|
||||
link_directories(BEFORE ${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/lib)
|
||||
link_directories(BEFORE ${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/lib)
|
||||
|
||||
if(PROJECT_IS_ARM64)
|
||||
link_libraries(winfsp-a64)
|
||||
|
@@ -1,27 +1,27 @@
|
||||
set(BINUTILS_VERSION 2.44)
|
||||
set(BOOST_MAJOR_VERSION 1)
|
||||
set(BOOST_MINOR_VERSION 88)
|
||||
set(BOOST_PATCH_VERSION 0)
|
||||
set(BOOST2_MAJOR_VERSION 1)
|
||||
set(BOOST2_MINOR_VERSION 76)
|
||||
set(BOOST2_PATCH_VERSION 0)
|
||||
set(CPP_HTTPLIB_VERSION 0.20.0)
|
||||
set(CURL_VERSION 8.13.0)
|
||||
set(CURL2_VERSION 8_13_0)
|
||||
set(EXPAT_VERSION 2.7.1)
|
||||
set(BOOST_MAJOR_VERSION 1)
|
||||
set(BOOST_MINOR_VERSION 88)
|
||||
set(BOOST_PATCH_VERSION 0)
|
||||
set(CPP_HTTPLIB_VERSION 0.23.1)
|
||||
set(CURL2_VERSION 8_15_0)
|
||||
set(CURL_VERSION 8.15.0)
|
||||
set(EXPAT2_VERSION 2_7_1)
|
||||
set(GCC_VERSION 14.2.0)
|
||||
set(GTEST_VERSION 1.16.0)
|
||||
set(EXPAT_VERSION 2.7.1)
|
||||
set(GCC_VERSION 15.1.0)
|
||||
set(GTEST_VERSION 1.17.0)
|
||||
set(ICU_VERSION 76-1)
|
||||
set(JSON_VERSION 3.12.0)
|
||||
set(LIBSODIUM_VERSION 1.0.20)
|
||||
set(MINGW_VERSION 12.0.0)
|
||||
set(OPENSSL_VERSION 3.5.0)
|
||||
set(MINGW_VERSION 13.0.0)
|
||||
set(OPENSSL_VERSION 3.5.1)
|
||||
set(PKG_CONFIG_VERSION 0.29.2)
|
||||
set(PUGIXML_VERSION 1.15)
|
||||
set(ROCKSDB_VERSION 10.0.1)
|
||||
set(SPDLOG_VERSION 1.15.2)
|
||||
set(SQLITE_VERSION 3490100)
|
||||
set(SQLITE2_VERSION 3.49.1)
|
||||
set(ROCKSDB_VERSION 10.4.2)
|
||||
set(SPDLOG_VERSION 1.15.3)
|
||||
set(SQLITE2_VERSION 3.50.3)
|
||||
set(SQLITE_VERSION 3500300)
|
||||
set(STDUUID_VERSION 1.2.3)
|
||||
set(ZLIB_VERSION 1.3.1)
|
||||
|
@@ -9,8 +9,8 @@ PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
|
||||
PROJECT_DESC="Mount utility for Sia and S3"
|
||||
|
||||
PROJECT_MAJOR_VERSION=2
|
||||
PROJECT_MINOR_VERSION=0
|
||||
PROJECT_REVISION_VERSION=6
|
||||
PROJECT_MINOR_VERSION=1
|
||||
PROJECT_REVISION_VERSION=0
|
||||
PROJECT_RELEASE_NUM=0
|
||||
PROJECT_RELEASE_ITER=rc
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#comment
|
||||
FROM arm64v8/alpine:3.21.3
|
||||
FROM arm64v8/alpine:3.21.4
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#comment
|
||||
FROM alpine:3.21.3
|
||||
FROM alpine:3.21.4
|
||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||
CMD bash
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#comment
|
||||
FROM alpine:3.21.3
|
||||
FROM alpine:3.21.4
|
||||
|
||||
RUN apk update
|
||||
RUN apk upgrade
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#define REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
|
||||
|
||||
#include "app_config.hpp"
|
||||
#include "comm/curl/curl_shared.hpp"
|
||||
#include "comm/curl/multi_request.hpp"
|
||||
#include "comm/i_http_comm.hpp"
|
||||
#include "events/event_system.hpp"
|
||||
@@ -48,6 +49,7 @@ private:
|
||||
|
||||
static const write_callback write_data;
|
||||
static const write_callback write_headers;
|
||||
static constexpr std::uint8_t retry_request_count{5U};
|
||||
|
||||
private:
|
||||
std::optional<host_config> host_config_;
|
||||
@@ -135,101 +137,125 @@ public:
|
||||
long &response_code, stop_type &stop_requested) -> bool {
|
||||
REPERTORY_USES_FUNCTION_NAME();
|
||||
|
||||
if (request.decryption_token.has_value() &&
|
||||
not request.decryption_token.value().empty()) {
|
||||
return make_encrypted_request(cfg, request, response_code,
|
||||
stop_requested);
|
||||
}
|
||||
|
||||
response_code = 0;
|
||||
|
||||
auto *curl = create_curl();
|
||||
if (not request.set_method(curl, stop_requested)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (not cfg.agent_string.empty()) {
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, cfg.agent_string.c_str());
|
||||
}
|
||||
|
||||
if (request.allow_timeout && cfg.timeout_ms) {
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, cfg.timeout_ms);
|
||||
}
|
||||
|
||||
std::string range_list{};
|
||||
if (request.range.has_value()) {
|
||||
range_list = std::to_string(request.range.value().begin) + '-' +
|
||||
std::to_string(request.range.value().end);
|
||||
curl_easy_setopt(curl, CURLOPT_RANGE, range_list.c_str());
|
||||
}
|
||||
|
||||
if (request.response_headers.has_value()) {
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERDATA,
|
||||
&request.response_headers.value());
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_headers);
|
||||
}
|
||||
|
||||
read_write_info write_info{
|
||||
{},
|
||||
[&stop_requested]() -> bool {
|
||||
return stop_requested || app_config::get_stop_requested();
|
||||
},
|
||||
};
|
||||
if (request.response_handler.has_value()) {
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_info);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
|
||||
}
|
||||
|
||||
std::string parameters{};
|
||||
for (const auto ¶m : request.query) {
|
||||
parameters += (parameters.empty() ? '?' : '&') + param.first + '=' +
|
||||
url_encode(curl, param.second, false);
|
||||
}
|
||||
|
||||
if (not cfg.api_password.empty()) {
|
||||
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_PASSWORD, cfg.api_password.c_str());
|
||||
} else if (not cfg.api_user.empty()) {
|
||||
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
|
||||
}
|
||||
|
||||
if (request.aws_service.has_value()) {
|
||||
curl_easy_setopt(curl, CURLOPT_AWS_SIGV4,
|
||||
request.aws_service.value().c_str());
|
||||
}
|
||||
|
||||
curl_slist *header_list{nullptr};
|
||||
if (not request.headers.empty()) {
|
||||
for (const auto &header : request.headers) {
|
||||
header_list = curl_slist_append(
|
||||
header_list,
|
||||
fmt::format("{}: {}", header.first, header.second).c_str());
|
||||
}
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_list);
|
||||
}
|
||||
|
||||
auto url = construct_url(curl, request.get_path(), cfg) + parameters;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
|
||||
multi_request curl_request(curl, stop_requested);
|
||||
|
||||
CURLcode curl_code{};
|
||||
curl_request.get_result(curl_code, response_code);
|
||||
const auto do_request = [&]() -> bool {
|
||||
if (request.decryption_token.has_value() &&
|
||||
not request.decryption_token.value().empty()) {
|
||||
return make_encrypted_request(cfg, request, response_code,
|
||||
stop_requested);
|
||||
}
|
||||
|
||||
if (header_list != nullptr) {
|
||||
curl_slist_free_all(header_list);
|
||||
response_code = 0;
|
||||
|
||||
auto *curl = create_curl();
|
||||
if (not request.set_method(curl, stop_requested)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (not cfg.agent_string.empty()) {
|
||||
curl_easy_setopt(curl, CURLOPT_USERAGENT, cfg.agent_string.c_str());
|
||||
}
|
||||
|
||||
if (request.allow_timeout && cfg.timeout_ms) {
|
||||
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, cfg.timeout_ms);
|
||||
}
|
||||
|
||||
std::string range_list{};
|
||||
if (request.range.has_value()) {
|
||||
range_list = std::to_string(request.range.value().begin) + '-' +
|
||||
std::to_string(request.range.value().end);
|
||||
curl_easy_setopt(curl, CURLOPT_RANGE, range_list.c_str());
|
||||
}
|
||||
|
||||
if (request.response_headers.has_value()) {
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERDATA,
|
||||
&request.response_headers.value());
|
||||
curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, write_headers);
|
||||
}
|
||||
|
||||
read_write_info write_info{
|
||||
{},
|
||||
[&stop_requested]() -> bool {
|
||||
return stop_requested || app_config::get_stop_requested();
|
||||
},
|
||||
};
|
||||
if (request.response_handler.has_value()) {
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_info);
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_data);
|
||||
}
|
||||
|
||||
std::string parameters{};
|
||||
for (const auto ¶m : request.query) {
|
||||
parameters += (parameters.empty() ? '?' : '&') + param.first + '=' +
|
||||
url_encode(curl, param.second, false);
|
||||
}
|
||||
|
||||
if (not cfg.api_password.empty()) {
|
||||
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
|
||||
curl_easy_setopt(curl, CURLOPT_PASSWORD, cfg.api_password.c_str());
|
||||
} else if (not cfg.api_user.empty()) {
|
||||
curl_easy_setopt(curl, CURLOPT_USERNAME, cfg.api_user.c_str());
|
||||
}
|
||||
|
||||
if (request.aws_service.has_value()) {
|
||||
curl_easy_setopt(curl, CURLOPT_AWS_SIGV4,
|
||||
request.aws_service.value().c_str());
|
||||
}
|
||||
|
||||
curl_slist *header_list{nullptr};
|
||||
if (not request.headers.empty()) {
|
||||
for (const auto &header : request.headers) {
|
||||
header_list = curl_slist_append(
|
||||
header_list,
|
||||
fmt::format("{}: {}", header.first, header.second).c_str());
|
||||
}
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header_list);
|
||||
}
|
||||
|
||||
curl_shared::set_share(curl);
|
||||
|
||||
auto url = construct_url(curl, request.get_path(), cfg) + parameters;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
|
||||
|
||||
multi_request curl_request(curl, stop_requested);
|
||||
|
||||
curl_code = CURLE_OK;
|
||||
curl_request.get_result(curl_code, response_code);
|
||||
|
||||
if (header_list != nullptr) {
|
||||
curl_slist_free_all(header_list);
|
||||
}
|
||||
|
||||
if (curl_code != CURLE_OK) {
|
||||
event_system::instance().raise<curl_error>(curl_code, function_name,
|
||||
request.get_type(), url);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (request.response_handler.has_value()) {
|
||||
request.response_handler.value()(write_info.data, response_code);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
bool ret{false};
|
||||
for (std::uint8_t retry = 0U; !ret && retry < retry_request_count;
|
||||
++retry) {
|
||||
ret = do_request();
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (curl_code == CURLE_COULDNT_RESOLVE_HOST) {
|
||||
std::this_thread::sleep_for(1s);
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (curl_code != CURLE_OK) {
|
||||
event_system::instance().raise<curl_error>(curl_code, function_name, url);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (request.response_handler.has_value()) {
|
||||
request.response_handler.value()(write_info.data, response_code);
|
||||
}
|
||||
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public:
|
||||
|
67
repertory/librepertory/include/comm/curl/curl_shared.hpp
Normal file
67
repertory/librepertory/include/comm/curl/curl_shared.hpp
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
Copyright <2018-2025> <scott.e.graves@protonmail.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
*/
|
||||
#ifndef REPERTORY_INCLUDE_COMM_CURL_CURL_SHARED_HPP_
|
||||
#define REPERTORY_INCLUDE_COMM_CURL_CURL_SHARED_HPP_
|
||||
|
||||
namespace repertory {
|
||||
class curl_shared final {
|
||||
private:
|
||||
struct curl_sh_deleter final {
|
||||
void operator()(CURLSH *ptr) {
|
||||
if (ptr != nullptr) {
|
||||
curl_share_cleanup(ptr);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
using curl_sh_t = std::unique_ptr<CURLSH, curl_sh_deleter>;
|
||||
|
||||
public:
|
||||
curl_shared() = delete;
|
||||
curl_shared(const curl_shared &) = delete;
|
||||
curl_shared(curl_shared &&) = delete;
|
||||
~curl_shared() = delete;
|
||||
|
||||
auto operator=(const curl_shared &) -> curl_shared & = delete;
|
||||
auto operator=(curl_shared &&) -> curl_shared & = delete;
|
||||
|
||||
private:
|
||||
static curl_sh_t cache_;
|
||||
static std::recursive_mutex mtx_;
|
||||
|
||||
private:
|
||||
static void lock_callback(CURL * /* curl */, curl_lock_data /* data */,
|
||||
curl_lock_access /* access */, void * /* ptr */);
|
||||
|
||||
static void unlock_callback(CURL * /* curl */, curl_lock_data /* data */,
|
||||
curl_lock_access /* access */, void * /* ptr */);
|
||||
|
||||
public:
|
||||
static void cleanup();
|
||||
|
||||
[[nodiscard]] static auto init() -> bool;
|
||||
|
||||
static void set_share(CURL *curl);
|
||||
};
|
||||
} // namespace repertory
|
||||
|
||||
#endif // REPERTORY_INCLUDE_COMM_CURL_DNS_CACHE_HPP_
|
@@ -26,11 +26,13 @@
|
||||
|
||||
namespace repertory::curl::requests {
|
||||
struct http_delete final : http_request_base {
|
||||
~http_delete() override = default;
|
||||
[[nodiscard]] auto get_type() const -> std::string override {
|
||||
return "delete";
|
||||
}
|
||||
|
||||
[[nodiscard]] auto
|
||||
set_method(CURL *curl,
|
||||
stop_type & /* stop_requested */) const -> bool override {
|
||||
[[nodiscard]] auto set_method(CURL *curl,
|
||||
stop_type & /* stop_requested */) const
|
||||
-> bool override {
|
||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||
return true;
|
||||
}
|
||||
|
@@ -33,9 +33,11 @@ struct http_get final : http_request_base {
|
||||
auto operator=(http_get &&) -> http_get & = default;
|
||||
~http_get() override = default;
|
||||
|
||||
[[nodiscard]] auto
|
||||
set_method(CURL *curl,
|
||||
stop_type & /*stop_requested*/) const -> bool override {
|
||||
[[nodiscard]] auto get_type() const -> std::string override { return "get"; }
|
||||
|
||||
[[nodiscard]] auto set_method(CURL *curl,
|
||||
stop_type & /*stop_requested*/) const
|
||||
-> bool override {
|
||||
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
|
||||
return true;
|
||||
}
|
||||
|
@@ -26,11 +26,11 @@
|
||||
|
||||
namespace repertory::curl::requests {
|
||||
struct http_head final : http_request_base {
|
||||
~http_head() override = default;
|
||||
[[nodiscard]] auto get_type() const -> std::string override { return "head"; }
|
||||
|
||||
[[nodiscard]] auto
|
||||
set_method(CURL *curl,
|
||||
stop_type & /* stop_requested */) const -> bool override {
|
||||
[[nodiscard]] auto set_method(CURL *curl,
|
||||
stop_type & /* stop_requested */) const
|
||||
-> bool override {
|
||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "HEAD");
|
||||
curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
|
||||
return true;
|
||||
|
@@ -26,16 +26,10 @@
|
||||
|
||||
namespace repertory::curl::requests {
|
||||
struct http_post final : http_request_base {
|
||||
http_post() = default;
|
||||
http_post(const http_post &) = default;
|
||||
http_post(http_post &&) = default;
|
||||
auto operator=(const http_post &) -> http_post & = default;
|
||||
auto operator=(http_post &&) -> http_post & = default;
|
||||
|
||||
~http_post() override = default;
|
||||
|
||||
std::optional<nlohmann::json> json;
|
||||
|
||||
[[nodiscard]] auto get_type() const -> std::string override { return "post"; }
|
||||
|
||||
[[nodiscard]] auto set_method(CURL *curl,
|
||||
stop_type & /*stop_requested*/) const
|
||||
-> bool override;
|
||||
|
@@ -27,18 +27,11 @@
|
||||
|
||||
namespace repertory::curl::requests {
|
||||
struct http_put_file final : http_request_base {
|
||||
http_put_file() = default;
|
||||
http_put_file(const http_put_file &) = default;
|
||||
http_put_file(http_put_file &&) = default;
|
||||
|
||||
auto operator=(const http_put_file &) -> http_put_file & = default;
|
||||
auto operator=(http_put_file &&) -> http_put_file & = default;
|
||||
|
||||
~http_put_file() override = default;
|
||||
|
||||
std::shared_ptr<utils::encryption::encrypting_reader> reader;
|
||||
std::string source_path;
|
||||
|
||||
[[nodiscard]] auto get_type() const -> std::string override { return "put"; }
|
||||
|
||||
[[nodiscard]] auto set_method(CURL *curl, stop_type &stop_requested) const
|
||||
-> bool override;
|
||||
|
||||
|
@@ -61,6 +61,8 @@ struct http_request_base {
|
||||
|
||||
[[nodiscard]] virtual auto get_path() const -> std::string { return path; }
|
||||
|
||||
[[nodiscard]] virtual auto get_type() const -> std::string = 0;
|
||||
|
||||
[[nodiscard]] virtual auto set_method(CURL *curl,
|
||||
stop_type &stop_requested) const
|
||||
-> bool = 0;
|
||||
|
@@ -94,7 +94,7 @@ private:
|
||||
bool shutdown_ = false;
|
||||
|
||||
private:
|
||||
static constexpr const auto min_pool_size = 10U;
|
||||
static constexpr auto min_pool_size = 10U;
|
||||
|
||||
public:
|
||||
void execute(const std::string &client_id, std::uint64_t thread_id,
|
||||
|
@@ -54,13 +54,13 @@ REPERTORY_IGNORE_WARNINGS_DISABLE()
|
||||
using namespace std::chrono_literals;
|
||||
using json = nlohmann::json;
|
||||
|
||||
inline constexpr const std::string_view REPERTORY{"repertory"};
|
||||
inline constexpr const std::string_view REPERTORY_DATA_NAME{"repertory2"};
|
||||
inline constexpr const std::wstring_view REPERTORY_W{L"repertory"};
|
||||
inline constexpr std::string_view REPERTORY{"repertory"};
|
||||
inline constexpr std::string_view REPERTORY_DATA_NAME{"repertory2"};
|
||||
inline constexpr std::wstring_view REPERTORY_W{L"repertory"};
|
||||
|
||||
inline constexpr const std::uint64_t REPERTORY_CONFIG_VERSION{2ULL};
|
||||
inline constexpr const std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"};
|
||||
inline constexpr const std::string_view RENTERD_MIN_VERSION{"2.0.0"};
|
||||
inline constexpr std::uint64_t REPERTORY_CONFIG_VERSION{2ULL};
|
||||
inline constexpr std::string_view REPERTORY_MIN_REMOTE_VERSION{"2.0.0"};
|
||||
inline constexpr std::string_view RENTERD_MIN_VERSION{"2.0.0"};
|
||||
|
||||
#define REPERTORY_INVALID_HANDLE INVALID_HANDLE_VALUE
|
||||
|
||||
|
@@ -64,17 +64,14 @@ protected:
|
||||
[[nodiscard]] auto get_effective_uid() const -> uid_t;
|
||||
|
||||
[[nodiscard]] static auto check_open_flags(int flags, int mask,
|
||||
const api_error &fail_error)
|
||||
-> api_error;
|
||||
api_error fail_error) -> api_error;
|
||||
|
||||
[[nodiscard]] auto check_owner(const api_meta_map &meta) const -> api_error;
|
||||
|
||||
[[nodiscard]] static auto check_readable(int flags,
|
||||
const api_error &fail_error)
|
||||
[[nodiscard]] static auto check_readable(int flags, api_error fail_error)
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] static auto check_writeable(int flags,
|
||||
const api_error &fail_error)
|
||||
[[nodiscard]] static auto check_writeable(int flags, api_error fail_error)
|
||||
-> api_error;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
|
@@ -35,9 +35,8 @@ public:
|
||||
~logging_consumer();
|
||||
|
||||
private:
|
||||
static constexpr const std::uint8_t MAX_LOG_FILES{5U};
|
||||
static constexpr const std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL *
|
||||
5ULL};
|
||||
static constexpr std::uint8_t MAX_LOG_FILES{5U};
|
||||
static constexpr std::uint64_t MAX_LOG_FILE_SIZE{1024ULL * 1024ULL * 5ULL};
|
||||
|
||||
private:
|
||||
static void process_event(const i_event &evt);
|
||||
|
@@ -27,7 +27,7 @@ class i_event;
|
||||
|
||||
class event_system final {
|
||||
private:
|
||||
static constexpr const std::uint8_t max_queue_retry{
|
||||
static constexpr std::uint8_t max_queue_retry{
|
||||
30U,
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
std::thread::hardware_concurrency() * 4U,
|
||||
};
|
||||
|
||||
static constexpr const std::chrono::seconds queue_wait_secs{
|
||||
static constexpr std::chrono::seconds queue_wait_secs{
|
||||
5s,
|
||||
};
|
||||
|
||||
|
@@ -28,16 +28,19 @@
|
||||
namespace repertory {
|
||||
struct curl_error final : public i_event {
|
||||
curl_error() = default;
|
||||
curl_error(CURLcode code_, std::string_view function_name_, std::string url_)
|
||||
curl_error(CURLcode code_, std::string_view function_name_, std::string type_,
|
||||
std::string url_)
|
||||
: code(code_),
|
||||
function_name(std::string{function_name_}),
|
||||
type(std::move(type_)),
|
||||
url(std::move(url_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"curl_error"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"curl_error"};
|
||||
|
||||
CURLcode code{};
|
||||
std::string function_name;
|
||||
std::string type;
|
||||
std::string url;
|
||||
|
||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||
@@ -49,8 +52,8 @@ struct curl_error final : public i_event {
|
||||
}
|
||||
|
||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||
return fmt::format("{}|func|{}|url|{}|code|{}", name, function_name, url,
|
||||
static_cast<int>(code));
|
||||
return fmt::format("{}|func|{}|type|{}|url|{}|code|{}", name, function_name,
|
||||
type, url, static_cast<int>(code));
|
||||
}
|
||||
};
|
||||
} // namespace repertory
|
||||
@@ -60,12 +63,14 @@ template <> struct adl_serializer<repertory::curl_error> {
|
||||
static void to_json(json &data, const repertory::curl_error &value) {
|
||||
data["code"] = value.code;
|
||||
data["function_name"] = value.function_name;
|
||||
data["type"] = value.type;
|
||||
data["url"] = value.url;
|
||||
}
|
||||
|
||||
static void from_json(const json &data, repertory::curl_error &value) {
|
||||
data.at("code").get_to<CURLcode>(value.code);
|
||||
data.at("function_name").get_to<std::string>(value.function_name);
|
||||
data.at("type").get_to<std::string>(value.type);
|
||||
data.at("url").get_to<std::string>(value.url);
|
||||
}
|
||||
};
|
||||
|
@@ -31,8 +31,8 @@ struct debug_log final : public i_event {
|
||||
debug_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"debug_log"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"debug_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@@ -34,8 +34,8 @@ struct directory_remove_failed final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"directory_remove_failed"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"directory_remove_failed"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@@ -32,8 +32,8 @@ struct directory_removed final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"directory_removed"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"directory_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -35,8 +35,8 @@ struct directory_removed_externally final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"directory_removed_externally"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"directory_removed_externally"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -34,8 +34,8 @@ struct download_begin final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_begin"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_begin"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -35,8 +35,8 @@ struct download_end final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_end"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_end"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -35,8 +35,8 @@ struct download_progress final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
progress(progress_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_progress"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_progress"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -35,8 +35,8 @@ struct download_restore_failed final : public i_event {
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"download_restore_failed"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"download_restore_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -34,8 +34,8 @@ struct download_restored final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"download_restored"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"download_restored"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -36,8 +36,8 @@ struct download_resume_add_failed final : public i_event {
|
||||
error(std::move(error_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"download_resume_add_failed"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"download_resume_add_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -34,8 +34,8 @@ struct download_resume_added final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_resume_added"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"download_resume_added"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -34,8 +34,8 @@ struct download_resume_removed final : public i_event {
|
||||
dest_path(std::move(dest_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_resume_removed"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"download_resume_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -35,8 +35,8 @@ struct download_type_selected final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
type(type_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"download_type_selected"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"download_type_selected"};
|
||||
|
||||
std::string api_path;
|
||||
std::string dest_path;
|
||||
|
@@ -35,8 +35,8 @@ struct drive_mount_failed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"drive_mount_failed"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"drive_mount_failed"};
|
||||
|
||||
NTSTATUS error{};
|
||||
std::string function_name;
|
||||
|
@@ -34,8 +34,8 @@ struct drive_mount_result final : public i_event {
|
||||
mount_location(std::move(mount_location_)),
|
||||
result(std::move(result_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_mount_result"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_mount_result"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@@ -32,8 +32,8 @@ struct drive_mounted final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_mounted"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_mounted"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@@ -31,8 +31,8 @@ struct drive_stop_timed_out final : public i_event {
|
||||
drive_stop_timed_out(std::string_view function_name_)
|
||||
: function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"drive_stop_timed_out"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"drive_stop_timed_out"};
|
||||
|
||||
std::string function_name;
|
||||
|
||||
|
@@ -33,8 +33,8 @@ struct drive_unmount_pending final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_unmount_pending"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_unmount_pending"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@@ -32,8 +32,8 @@ struct drive_unmounted final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
mount_location(std::move(mount_location_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"drive_unmounted"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"drive_unmounted"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@@ -31,8 +31,8 @@ struct event_level_changed final : public i_event {
|
||||
event_level_changed(std::string_view function_name_, event_level new_level_)
|
||||
: function_name(std::string(function_name_)), new_level(new_level_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"event_level_changed"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"event_level_changed"};
|
||||
|
||||
std::string function_name;
|
||||
event_level new_level{};
|
||||
|
@@ -32,8 +32,8 @@ struct file_pinned final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_pinned"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_pinned"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -34,8 +34,8 @@ struct file_remove_failed final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"file_remove_failed"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"file_remove_failed"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@@ -32,8 +32,8 @@ struct file_removed final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"file_removed"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"file_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -35,8 +35,8 @@ struct file_removed_externally final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_removed_externally"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_removed_externally"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -32,8 +32,8 @@ struct file_unpinned final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_unpinned"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_unpinned"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -37,8 +37,8 @@ struct file_upload_completed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_upload_completed"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_upload_completed"};
|
||||
|
||||
std::string api_path;
|
||||
bool cancelled{};
|
||||
|
@@ -35,8 +35,8 @@ struct file_upload_failed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_failed"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_upload_failed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string error;
|
||||
|
@@ -34,8 +34,8 @@ struct file_upload_not_found final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_not_found"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_upload_not_found"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -34,8 +34,8 @@ struct file_upload_queued final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"file_upload_queued"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"file_upload_queued"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -32,8 +32,8 @@ struct file_upload_removed final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"file_upload_removed"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"file_upload_removed"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -35,8 +35,8 @@ struct file_upload_retry final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"file_upload_retry"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"file_upload_retry"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@@ -35,8 +35,8 @@ struct filesystem_item_added final : public i_event {
|
||||
directory(directory_),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"filesystem_item_added"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"filesystem_item_added"};
|
||||
|
||||
std::string api_parent;
|
||||
std::string api_path;
|
||||
|
@@ -37,8 +37,8 @@ struct filesystem_item_closed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_closed"};
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_closed"};
|
||||
|
||||
std::string api_path;
|
||||
bool changed{};
|
||||
|
@@ -35,8 +35,8 @@ struct filesystem_item_evicted final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"filesystem_item_evicted"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"filesystem_item_evicted"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -39,8 +39,8 @@ struct filesystem_item_handle_closed final : public i_event {
|
||||
handle(handle_),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_handle_closed"};
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_handle_closed"};
|
||||
|
||||
std::string api_path;
|
||||
bool changed{};
|
||||
|
@@ -37,8 +37,8 @@ struct filesystem_item_handle_opened final : public i_event {
|
||||
handle(handle_),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_handle_opened"};
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_handle_opened"};
|
||||
|
||||
std::string api_path;
|
||||
bool directory{};
|
||||
|
@@ -36,8 +36,8 @@ struct filesystem_item_opened final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"filesystem_item_opened"};
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"filesystem_item_opened"};
|
||||
|
||||
std::string api_path;
|
||||
bool directory{};
|
||||
|
@@ -32,8 +32,8 @@ struct fuse_args_parsed final : public i_event {
|
||||
fuse_args_parsed(std::string_view args_, std::string_view function_name_)
|
||||
: args(std::move(args_)), function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"fuse_args_parsed"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"fuse_args_parsed"};
|
||||
|
||||
std::string args;
|
||||
std::string function_name;
|
||||
|
@@ -35,8 +35,8 @@ struct fuse_event final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"fuse_event"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"fuse_event"};
|
||||
|
||||
std::string api_path;
|
||||
std::int32_t error{};
|
||||
|
@@ -31,8 +31,8 @@ struct info_log final : public i_event {
|
||||
info_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"info_log"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"info_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@@ -34,8 +34,8 @@ struct invalid_cache_size final : public i_event {
|
||||
function_name(std::string{function_name_}),
|
||||
invalid_size(invalid_size_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"invalid_cache_size"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"invalid_cache_size"};
|
||||
|
||||
std::uint64_t cache_size{};
|
||||
std::string function_name;
|
||||
|
@@ -32,8 +32,8 @@ struct item_timeout final : public i_event {
|
||||
: api_path(std::move(api_path_)),
|
||||
function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"item_timeout"};
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"item_timeout"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -35,8 +35,8 @@ struct max_cache_size_reached final : public i_event {
|
||||
function_name(std::string{function_name_}),
|
||||
max_cache_size(max_cache_size_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"max_cache_size_reached"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"max_cache_size_reached"};
|
||||
|
||||
std::uint64_t cache_size{};
|
||||
std::string function_name;
|
||||
|
@@ -33,8 +33,8 @@ struct orphaned_file_detected final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"orphaned_file_detected"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"orphaned_file_detected"};
|
||||
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
@@ -36,8 +36,8 @@ struct orphaned_file_processing_failed final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{
|
||||
"orphaned_file_processing_failed",
|
||||
};
|
||||
|
||||
|
@@ -33,8 +33,8 @@ struct orphaned_source_file_detected final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"orphaned_source_file_detected"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"orphaned_source_file_detected"};
|
||||
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
@@ -33,8 +33,8 @@ struct orphaned_source_file_removed final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"orphaned_source_file_removed"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"orphaned_source_file_removed"};
|
||||
|
||||
std::string function_name;
|
||||
std::string source_path;
|
||||
|
@@ -34,8 +34,8 @@ struct packet_client_timeout final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"packet_client_timeout"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"packet_client_timeout"};
|
||||
|
||||
std::string event_name;
|
||||
std::string function_name;
|
||||
|
@@ -32,8 +32,8 @@ struct polling_item_begin final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
item_name(std::move(item_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"polling_item_begin"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"polling_item_begin"};
|
||||
|
||||
std::string function_name;
|
||||
std::string item_name;
|
||||
|
@@ -32,8 +32,8 @@ struct polling_item_end final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
item_name(std::move(item_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"polling_item_end"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"polling_item_end"};
|
||||
|
||||
std::string function_name;
|
||||
std::string item_name;
|
||||
|
@@ -35,8 +35,8 @@ struct provider_invalid_version final : public i_event {
|
||||
required_version(std::move(required_version_)),
|
||||
returned_version(std::move(returned_version_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"provider_invalid_version"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"provider_invalid_version"};
|
||||
|
||||
std::string function_name;
|
||||
std::string required_version;
|
||||
|
@@ -34,8 +34,8 @@ struct provider_offline final : public i_event {
|
||||
host_name_or_ip(std::move(host_name_or_ip_)),
|
||||
port(port_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"provider_offline"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"provider_offline"};
|
||||
|
||||
std::string function_name;
|
||||
std::string host_name_or_ip;
|
||||
|
@@ -34,8 +34,8 @@ struct provider_upload_begin final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"provider_upload_begin"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"provider_upload_begin"};
|
||||
|
||||
std::string api_path;
|
||||
std::string function_name;
|
||||
|
@@ -35,8 +35,8 @@ struct provider_upload_end final : public i_event {
|
||||
function_name(std::string(function_name_)),
|
||||
source_path(std::move(source_path_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"provider_upload_end"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"provider_upload_end"};
|
||||
|
||||
std::string api_path;
|
||||
api_error error{};
|
||||
|
@@ -35,8 +35,8 @@ struct remote_server_event final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"remote_server_event"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"remote_server_event"};
|
||||
|
||||
std::string api_path;
|
||||
packet::error_type error{};
|
||||
|
@@ -31,8 +31,8 @@ struct repertory_exception final : public i_event {
|
||||
repertory_exception(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::error};
|
||||
static constexpr const std::string_view name{"repertory_exception"};
|
||||
static constexpr event_level level{event_level::error};
|
||||
static constexpr std::string_view name{"repertory_exception"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@@ -33,8 +33,8 @@ struct service_start_begin final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_start_begin"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_start_begin"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@@ -32,8 +32,8 @@ struct service_start_end final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_start_end"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_start_end"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@@ -32,8 +32,8 @@ struct service_stop_begin final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_stop_begin"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_stop_begin"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@@ -32,8 +32,8 @@ struct service_stop_end final : public i_event {
|
||||
: function_name(std::string(function_name_)),
|
||||
service_name(std::move(service_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"service_stop_end"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"service_stop_end"};
|
||||
|
||||
std::string function_name;
|
||||
std::string service_name;
|
||||
|
@@ -31,8 +31,8 @@ struct trace_log final : public i_event {
|
||||
trace_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::trace};
|
||||
static constexpr const std::string_view name{"trace_log"};
|
||||
static constexpr event_level level{event_level::trace};
|
||||
static constexpr std::string_view name{"trace_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@@ -31,8 +31,8 @@ struct unmount_requested final : public i_event {
|
||||
unmount_requested(std::string_view function_name_)
|
||||
: function_name(std::string(function_name_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"unmount_requested"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"unmount_requested"};
|
||||
|
||||
std::string function_name;
|
||||
|
||||
|
@@ -35,8 +35,8 @@ struct unmount_result final : public i_event {
|
||||
mount_location(std::move(mount_location_)),
|
||||
result(result_) {}
|
||||
|
||||
static constexpr const event_level level{event_level::info};
|
||||
static constexpr const std::string_view name{"unmount_result"};
|
||||
static constexpr event_level level{event_level::info};
|
||||
static constexpr std::string_view name{"unmount_result"};
|
||||
|
||||
std::string function_name;
|
||||
std::string mount_location;
|
||||
|
@@ -31,8 +31,8 @@ struct warn_log final : public i_event {
|
||||
warn_log(std::string_view function_name_, std::string msg_)
|
||||
: function_name(std::string(function_name_)), msg(std::move(msg_)) {}
|
||||
|
||||
static constexpr const event_level level{event_level::warn};
|
||||
static constexpr const std::string_view name{"warn_log"};
|
||||
static constexpr event_level level{event_level::warn};
|
||||
static constexpr std::string_view name{"warn_log"};
|
||||
|
||||
std::string function_name;
|
||||
std::string msg;
|
||||
|
@@ -35,8 +35,8 @@ struct winfsp_event final : public i_event {
|
||||
error(error_),
|
||||
function_name(std::string{function_name_}) {}
|
||||
|
||||
static constexpr const event_level level{event_level::debug};
|
||||
static constexpr const std::string_view name{"winfsp_event"};
|
||||
static constexpr event_level level{event_level::debug};
|
||||
static constexpr std::string_view name{"winfsp_event"};
|
||||
|
||||
std::string api_path;
|
||||
NTSTATUS error{};
|
||||
|
@@ -29,7 +29,7 @@ class app_config;
|
||||
|
||||
class cache_size_mgr final {
|
||||
private:
|
||||
static constexpr const std::chrono::seconds cache_wait_secs{
|
||||
static constexpr std::chrono::seconds cache_wait_secs{
|
||||
5s,
|
||||
};
|
||||
|
||||
|
@@ -40,7 +40,7 @@ class file_manager final : public i_file_manager, public i_upload_manager {
|
||||
E_CONSUMER();
|
||||
|
||||
private:
|
||||
static constexpr const std::chrono::seconds queue_wait_secs{
|
||||
static constexpr std::chrono::seconds queue_wait_secs{
|
||||
5s,
|
||||
};
|
||||
|
||||
|
@@ -66,7 +66,7 @@ public:
|
||||
std::condition_variable notify_;
|
||||
|
||||
public:
|
||||
void notify(const api_error &err);
|
||||
void notify(api_error err);
|
||||
|
||||
auto wait() -> api_error;
|
||||
};
|
||||
@@ -149,7 +149,7 @@ protected:
|
||||
|
||||
void reset_timeout();
|
||||
|
||||
auto set_api_error(const api_error &err) -> api_error;
|
||||
auto set_api_error(api_error err) -> api_error;
|
||||
|
||||
void set_file_size(std::uint64_t size);
|
||||
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
-> ring_buffer_base & = delete;
|
||||
|
||||
public:
|
||||
static constexpr const auto min_ring_size{5U};
|
||||
static constexpr auto min_ring_size{5U};
|
||||
|
||||
private:
|
||||
boost::dynamic_bitset<> read_state_;
|
||||
|
@@ -84,6 +84,8 @@ private:
|
||||
|
||||
void remove_deleted_files(stop_type &stop_requested);
|
||||
|
||||
void remove_expired_files();
|
||||
|
||||
public:
|
||||
[[nodiscard]] auto check_version(std::string &required_version,
|
||||
std::string &returned_version) const
|
||||
|
@@ -70,8 +70,9 @@ private:
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto get_last_modified(bool directory,
|
||||
const std::string &api_path) const
|
||||
-> std::uint64_t;
|
||||
const std::string &api_path,
|
||||
std::uint64_t &last_modified) const
|
||||
-> api_error;
|
||||
|
||||
[[nodiscard]] auto
|
||||
get_object_info(bool directory, const std::string &api_path,
|
||||
|
@@ -30,8 +30,13 @@ class app_config;
|
||||
class server {
|
||||
public:
|
||||
explicit server(app_config &config);
|
||||
server(const server &) = delete;
|
||||
server(server &&) = delete;
|
||||
|
||||
virtual ~server() { stop(); }
|
||||
auto operator=(const server &) -> server & = delete;
|
||||
auto operator=(server &&) -> server & = delete;
|
||||
|
||||
virtual ~server();
|
||||
|
||||
private:
|
||||
app_config &config_;
|
||||
|
@@ -24,20 +24,20 @@
|
||||
|
||||
#include "types/repertory.hpp"
|
||||
|
||||
inline constexpr const auto PACKET_SERVICE_FUSE{1U};
|
||||
inline constexpr const auto PACKET_SERVICE_WINFSP{2U};
|
||||
inline constexpr auto PACKET_SERVICE_FUSE{1U};
|
||||
inline constexpr auto PACKET_SERVICE_WINFSP{2U};
|
||||
|
||||
#if defined(_WIN32)
|
||||
inline constexpr const auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_WINFSP};
|
||||
inline constexpr auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_WINFSP};
|
||||
#else // !defined(_WIN32)
|
||||
inline constexpr const auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_FUSE};
|
||||
inline constexpr auto PACKET_SERVICE_FLAGS{PACKET_SERVICE_FUSE};
|
||||
#endif // defined(_WIN32)
|
||||
|
||||
constexpr const auto default_remote_directory_page_size{std::size_t(100U)};
|
||||
constexpr const auto default_remote_client_pool_size{20U};
|
||||
constexpr const auto default_remote_max_connections{20U};
|
||||
constexpr const auto default_remote_receive_timeout_ms{120U * 1000U};
|
||||
constexpr const auto default_remote_send_timeout_ms{30U * 1000U};
|
||||
inline constexpr auto default_remote_directory_page_size{std::size_t(100U)};
|
||||
inline constexpr auto default_remote_client_pool_size{20U};
|
||||
inline constexpr auto default_remote_max_connections{20U};
|
||||
inline constexpr auto default_remote_receive_timeout_ms{120U * 1000U};
|
||||
inline constexpr auto default_remote_send_timeout_ms{30U * 1000U};
|
||||
|
||||
namespace repertory::remote {
|
||||
struct remote_config final {
|
||||
|
@@ -23,32 +23,36 @@
|
||||
#define REPERTORY_INCLUDE_TYPES_REPERTORY_HPP_
|
||||
|
||||
namespace repertory {
|
||||
constexpr const auto default_api_password_size{48U};
|
||||
constexpr const auto default_download_timeout_secs{30U};
|
||||
constexpr const auto default_eviction_delay_mins{1U};
|
||||
constexpr const auto default_high_freq_interval_secs{std::uint16_t{30U}};
|
||||
constexpr const auto default_low_freq_interval_secs{std::uint16_t(60U * 60U)};
|
||||
constexpr const auto default_max_cache_size_bytes{
|
||||
inline constexpr auto default_api_password_size{48U};
|
||||
inline constexpr auto default_download_timeout_secs{30U};
|
||||
inline constexpr auto default_eviction_delay_mins{1U};
|
||||
inline constexpr auto default_high_freq_interval_secs{std::uint16_t{30U}};
|
||||
inline constexpr auto default_low_freq_interval_secs{
|
||||
std::uint16_t(60U * 60U),
|
||||
};
|
||||
inline constexpr auto default_max_cache_size_bytes{
|
||||
std::uint64_t(20ULL * 1024ULL * 1024ULL * 1024ULL),
|
||||
};
|
||||
constexpr const auto default_max_upload_count{5U};
|
||||
constexpr const auto default_med_freq_interval_secs{std::uint16_t{2U * 60U}};
|
||||
constexpr const auto default_online_check_retry_secs{60U};
|
||||
constexpr const auto default_retry_read_count{6U};
|
||||
constexpr const auto default_ring_buffer_file_size{512U};
|
||||
constexpr const auto default_task_wait_ms{100U};
|
||||
constexpr const auto default_timeout_ms{60000U};
|
||||
constexpr const auto default_ui_mgmt_port{std::uint16_t{30000U}};
|
||||
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)};
|
||||
constexpr const auto max_s3_object_name_length{1024U};
|
||||
constexpr const auto min_cache_size_bytes{
|
||||
inline constexpr auto default_max_upload_count{5U};
|
||||
inline constexpr auto default_med_freq_interval_secs{
|
||||
std::uint16_t{2U * 60U},
|
||||
};
|
||||
inline constexpr auto default_online_check_retry_secs{60U};
|
||||
inline constexpr auto default_retry_read_count{6U};
|
||||
inline constexpr auto default_ring_buffer_file_size{512U};
|
||||
inline constexpr auto default_task_wait_ms{100U};
|
||||
inline constexpr auto default_timeout_ms{60000U};
|
||||
inline constexpr auto default_ui_mgmt_port{std::uint16_t{30000U}};
|
||||
inline constexpr auto max_ring_buffer_file_size{std::uint16_t(1024U)};
|
||||
inline constexpr auto max_s3_object_name_length{1024U};
|
||||
inline constexpr auto min_cache_size_bytes{
|
||||
std::uint64_t(100ULL * 1024ULL * 1024ULL),
|
||||
};
|
||||
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
|
||||
constexpr const auto min_online_check_retry_secs{std::uint16_t(15U)};
|
||||
constexpr const auto min_retry_read_count{std::uint16_t(2U)};
|
||||
constexpr const auto min_ring_buffer_file_size{std::uint16_t(64U)};
|
||||
constexpr const auto min_task_wait_ms{std::uint16_t(50U)};
|
||||
inline constexpr auto min_download_timeout_secs{std::uint8_t(5U)};
|
||||
inline constexpr auto min_online_check_retry_secs{std::uint16_t(15U)};
|
||||
inline constexpr auto min_retry_read_count{std::uint16_t(2U)};
|
||||
inline constexpr auto min_ring_buffer_file_size{std::uint16_t(64U)};
|
||||
inline constexpr auto min_task_wait_ms{std::uint16_t(50U)};
|
||||
|
||||
template <typename data_t> class atomic final {
|
||||
public:
|
||||
@@ -139,28 +143,28 @@ public:
|
||||
[[nodiscard]] operator data_t() const { return load(); }
|
||||
};
|
||||
|
||||
inline constexpr const auto max_time{
|
||||
inline constexpr auto max_time{
|
||||
std::numeric_limits<std::uint64_t>::max(),
|
||||
};
|
||||
|
||||
inline constexpr const std::string META_ACCESSED{"accessed"};
|
||||
inline constexpr const std::string META_ATTRIBUTES{"attributes"};
|
||||
inline constexpr const std::string META_BACKUP{"backup"};
|
||||
inline constexpr const std::string META_CHANGED{"changed"};
|
||||
inline constexpr const std::string META_CREATION{"creation"};
|
||||
inline constexpr const std::string META_DIRECTORY{"directory"};
|
||||
inline constexpr const std::string META_GID{"gid"};
|
||||
inline constexpr const std::string META_KEY{"key"};
|
||||
inline constexpr const std::string META_MODE{"mode"};
|
||||
inline constexpr const std::string META_MODIFIED{"modified"};
|
||||
inline constexpr const std::string META_OSXFLAGS{"flags"};
|
||||
inline constexpr const std::string META_PINNED{"pinned"};
|
||||
inline constexpr const std::string META_SIZE{"size"};
|
||||
inline constexpr const std::string META_SOURCE{"source"};
|
||||
inline constexpr const std::string META_UID{"uid"};
|
||||
inline constexpr const std::string META_WRITTEN{"written"};
|
||||
inline constexpr std::string META_ACCESSED{"accessed"};
|
||||
inline constexpr std::string META_ATTRIBUTES{"attributes"};
|
||||
inline constexpr std::string META_BACKUP{"backup"};
|
||||
inline constexpr std::string META_CHANGED{"changed"};
|
||||
inline constexpr std::string META_CREATION{"creation"};
|
||||
inline constexpr std::string META_DIRECTORY{"directory"};
|
||||
inline constexpr std::string META_GID{"gid"};
|
||||
inline constexpr std::string META_KEY{"key"};
|
||||
inline constexpr std::string META_MODE{"mode"};
|
||||
inline constexpr std::string META_MODIFIED{"modified"};
|
||||
inline constexpr std::string META_OSXFLAGS{"flags"};
|
||||
inline constexpr std::string META_PINNED{"pinned"};
|
||||
inline constexpr std::string META_SIZE{"size"};
|
||||
inline constexpr std::string META_SOURCE{"source"};
|
||||
inline constexpr std::string META_UID{"uid"};
|
||||
inline constexpr std::string META_WRITTEN{"written"};
|
||||
|
||||
inline constexpr const std::array<std::string, 16U> META_USED_NAMES = {
|
||||
inline constexpr std::array<std::string, 16U> META_USED_NAMES = {
|
||||
META_ACCESSED, META_ATTRIBUTES, META_BACKUP, META_CHANGED,
|
||||
META_CREATION, META_DIRECTORY, META_GID, META_KEY,
|
||||
META_MODE, META_MODIFIED, META_OSXFLAGS, META_PINNED,
|
||||
@@ -217,8 +221,7 @@ enum class api_error {
|
||||
|
||||
[[nodiscard]] auto api_error_from_string(std::string_view str) -> api_error;
|
||||
|
||||
[[nodiscard]] auto api_error_to_string(const api_error &error)
|
||||
-> const std::string &;
|
||||
[[nodiscard]] auto api_error_to_string(api_error error) -> const std::string &;
|
||||
|
||||
enum class database_type {
|
||||
rocksdb,
|
||||
@@ -467,66 +470,58 @@ using api_item_added_callback = std::function<api_error(bool, api_file &)>;
|
||||
using directory_item_list = std::vector<directory_item>;
|
||||
using meta_provider_callback = std::function<void(directory_item &)>;
|
||||
|
||||
inline constexpr const auto JSON_ACCESS_KEY{"AccessKey"};
|
||||
inline constexpr const auto JSON_AGENT_STRING{"AgentString"};
|
||||
inline constexpr const auto JSON_API_PARENT{"ApiParent"};
|
||||
inline constexpr const auto JSON_API_PASSWORD{"ApiPassword"};
|
||||
inline constexpr const auto JSON_API_PATH{"ApiPath"};
|
||||
inline constexpr const auto JSON_API_PORT{"ApiPort"};
|
||||
inline constexpr const auto JSON_API_USER{"ApiUser"};
|
||||
inline constexpr const auto JSON_BUCKET{"Bucket"};
|
||||
inline constexpr const auto JSON_CLIENT_POOL_SIZE{"ClientPoolSize"};
|
||||
inline constexpr const auto JSON_DATABASE_TYPE{"DatabaseType"};
|
||||
inline constexpr const auto JSON_DIRECTORY{"Directory"};
|
||||
inline constexpr const auto JSON_DOWNLOAD_TIMEOUT_SECS{
|
||||
"DownloadTimeoutSeconds"};
|
||||
inline constexpr const auto JSON_ENABLE_DRIVE_EVENTS{"EnableDriveEvents"};
|
||||
inline constexpr const auto JSON_ENABLE_DOWNLOAD_TIMEOUT{
|
||||
"EnableDownloadTimeout"};
|
||||
inline constexpr const auto JSON_ENABLE_MOUNT_MANAGER{"EnableMountManager"};
|
||||
inline constexpr const auto JSON_ENABLE_REMOTE_MOUNT{"Enable"};
|
||||
inline constexpr const auto JSON_ENCRYPTION_TOKEN{"EncryptionToken"};
|
||||
inline constexpr const auto JSON_ENCRYPT_CONFIG{"EncryptConfig"};
|
||||
inline constexpr const auto JSON_EVENT_LEVEL{"EventLevel"};
|
||||
inline constexpr const auto JSON_EVICTION_DELAY_MINS{"EvictionDelayMinutes"};
|
||||
inline constexpr const auto JSON_EVICTION_USE_ACCESS_TIME{
|
||||
"EvictionUseAccessedTime"};
|
||||
inline constexpr const auto JSON_HIGH_FREQ_INTERVAL_SECS{
|
||||
"HighFreqIntervalSeconds"};
|
||||
inline constexpr const auto JSON_HOST_CONFIG{"HostConfig"};
|
||||
inline constexpr const auto JSON_HOST_NAME_OR_IP{"HostNameOrIp"};
|
||||
inline constexpr const auto JSON_LOW_FREQ_INTERVAL_SECS{
|
||||
"LowFreqIntervalSeconds"};
|
||||
inline constexpr const auto JSON_MAX_CACHE_SIZE_BYTES{"MaxCacheSizeBytes"};
|
||||
inline constexpr const auto JSON_MAX_CONNECTIONS{"MaxConnections"};
|
||||
inline constexpr const auto JSON_MAX_UPLOAD_COUNT{"MaxUploadCount"};
|
||||
inline constexpr const auto JSON_MED_FREQ_INTERVAL_SECS{
|
||||
"MedFreqIntervalSeconds"};
|
||||
inline constexpr const auto JSON_META{"Meta"};
|
||||
inline constexpr const auto JSON_MOUNT_LOCATIONS{"MountLocations"};
|
||||
inline constexpr const auto JSON_ONLINE_CHECK_RETRY_SECS{
|
||||
"OnlineCheckRetrySeconds"};
|
||||
inline constexpr const auto JSON_PATH{"Path"};
|
||||
inline constexpr const auto JSON_PREFERRED_DOWNLOAD_TYPE{
|
||||
"PreferredDownloadType"};
|
||||
inline constexpr const auto JSON_PROTOCOL{"Protocol"};
|
||||
inline constexpr const auto JSON_RECV_TIMEOUT_MS{"ReceiveTimeoutMs"};
|
||||
inline constexpr const auto JSON_REGION{"Region"};
|
||||
inline constexpr const auto JSON_REMOTE_CONFIG{"RemoteConfig"};
|
||||
inline constexpr const auto JSON_REMOTE_MOUNT{"RemoteMount"};
|
||||
inline constexpr const auto JSON_RETRY_READ_COUNT{"RetryReadCount"};
|
||||
inline constexpr const auto JSON_RING_BUFFER_FILE_SIZE{"RingBufferFileSize"};
|
||||
inline constexpr const auto JSON_S3_CONFIG{"S3Config"};
|
||||
inline constexpr const auto JSON_SECRET_KEY{"SecretKey"};
|
||||
inline constexpr const auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"};
|
||||
inline constexpr const auto JSON_SIA_CONFIG{"SiaConfig"};
|
||||
inline constexpr const auto JSON_SIZE{"Size"};
|
||||
inline constexpr const auto JSON_TASK_WAIT_MS{"TaskWaitMs"};
|
||||
inline constexpr const auto JSON_TIMEOUT_MS{"TimeoutMs"};
|
||||
inline constexpr const auto JSON_URL{"URL"};
|
||||
inline constexpr const auto JSON_USE_PATH_STYLE{"UsePathStyle"};
|
||||
inline constexpr const auto JSON_USE_REGION_IN_URL{"UseRegionInURL"};
|
||||
inline constexpr const auto JSON_VERSION{"Version"};
|
||||
inline constexpr auto JSON_ACCESS_KEY{"AccessKey"};
|
||||
inline constexpr auto JSON_AGENT_STRING{"AgentString"};
|
||||
inline constexpr auto JSON_API_PARENT{"ApiParent"};
|
||||
inline constexpr auto JSON_API_PASSWORD{"ApiPassword"};
|
||||
inline constexpr auto JSON_API_PATH{"ApiPath"};
|
||||
inline constexpr auto JSON_API_PORT{"ApiPort"};
|
||||
inline constexpr auto JSON_API_USER{"ApiUser"};
|
||||
inline constexpr auto JSON_BUCKET{"Bucket"};
|
||||
inline constexpr auto JSON_CLIENT_POOL_SIZE{"ClientPoolSize"};
|
||||
inline constexpr auto JSON_DATABASE_TYPE{"DatabaseType"};
|
||||
inline constexpr auto JSON_DIRECTORY{"Directory"};
|
||||
inline constexpr auto JSON_DOWNLOAD_TIMEOUT_SECS{"DownloadTimeoutSeconds"};
|
||||
inline constexpr auto JSON_ENABLE_DRIVE_EVENTS{"EnableDriveEvents"};
|
||||
inline constexpr auto JSON_ENABLE_DOWNLOAD_TIMEOUT{"EnableDownloadTimeout"};
|
||||
inline constexpr auto JSON_ENABLE_MOUNT_MANAGER{"EnableMountManager"};
|
||||
inline constexpr auto JSON_ENABLE_REMOTE_MOUNT{"Enable"};
|
||||
inline constexpr auto JSON_ENCRYPTION_TOKEN{"EncryptionToken"};
|
||||
inline constexpr auto JSON_ENCRYPT_CONFIG{"EncryptConfig"};
|
||||
inline constexpr auto JSON_EVENT_LEVEL{"EventLevel"};
|
||||
inline constexpr auto JSON_EVICTION_DELAY_MINS{"EvictionDelayMinutes"};
|
||||
inline constexpr auto JSON_EVICTION_USE_ACCESS_TIME{"EvictionUseAccessedTime"};
|
||||
inline constexpr auto JSON_HIGH_FREQ_INTERVAL_SECS{"HighFreqIntervalSeconds"};
|
||||
inline constexpr auto JSON_HOST_CONFIG{"HostConfig"};
|
||||
inline constexpr auto JSON_HOST_NAME_OR_IP{"HostNameOrIp"};
|
||||
inline constexpr auto JSON_LOW_FREQ_INTERVAL_SECS{"LowFreqIntervalSeconds"};
|
||||
inline constexpr auto JSON_MAX_CACHE_SIZE_BYTES{"MaxCacheSizeBytes"};
|
||||
inline constexpr auto JSON_MAX_CONNECTIONS{"MaxConnections"};
|
||||
inline constexpr auto JSON_MAX_UPLOAD_COUNT{"MaxUploadCount"};
|
||||
inline constexpr auto JSON_MED_FREQ_INTERVAL_SECS{"MedFreqIntervalSeconds"};
|
||||
inline constexpr auto JSON_META{"Meta"};
|
||||
inline constexpr auto JSON_MOUNT_LOCATIONS{"MountLocations"};
|
||||
inline constexpr auto JSON_ONLINE_CHECK_RETRY_SECS{"OnlineCheckRetrySeconds"};
|
||||
inline constexpr auto JSON_PATH{"Path"};
|
||||
inline constexpr auto JSON_PREFERRED_DOWNLOAD_TYPE{"PreferredDownloadType"};
|
||||
inline constexpr auto JSON_PROTOCOL{"Protocol"};
|
||||
inline constexpr auto JSON_RECV_TIMEOUT_MS{"ReceiveTimeoutMs"};
|
||||
inline constexpr auto JSON_REGION{"Region"};
|
||||
inline constexpr auto JSON_REMOTE_CONFIG{"RemoteConfig"};
|
||||
inline constexpr auto JSON_REMOTE_MOUNT{"RemoteMount"};
|
||||
inline constexpr auto JSON_RETRY_READ_COUNT{"RetryReadCount"};
|
||||
inline constexpr auto JSON_RING_BUFFER_FILE_SIZE{"RingBufferFileSize"};
|
||||
inline constexpr auto JSON_S3_CONFIG{"S3Config"};
|
||||
inline constexpr auto JSON_SECRET_KEY{"SecretKey"};
|
||||
inline constexpr auto JSON_SEND_TIMEOUT_MS{"SendTimeoutMs"};
|
||||
inline constexpr auto JSON_SIA_CONFIG{"SiaConfig"};
|
||||
inline constexpr auto JSON_SIZE{"Size"};
|
||||
inline constexpr auto JSON_TASK_WAIT_MS{"TaskWaitMs"};
|
||||
inline constexpr auto JSON_TIMEOUT_MS{"TimeoutMs"};
|
||||
inline constexpr auto JSON_URL{"URL"};
|
||||
inline constexpr auto JSON_USE_PATH_STYLE{"UsePathStyle"};
|
||||
inline constexpr auto JSON_USE_REGION_IN_URL{"UseRegionInURL"};
|
||||
inline constexpr auto JSON_VERSION{"Version"};
|
||||
} // namespace repertory
|
||||
|
||||
NLOHMANN_JSON_NAMESPACE_BEGIN
|
||||
|
@@ -28,36 +28,36 @@ namespace repertory::utils::cli {
|
||||
using option = std::array<std::string, 2>;
|
||||
|
||||
namespace options {
|
||||
static const option check_version_option = {"-cv", "--check_version"};
|
||||
static const option display_config_option = {"-dc", "--display_config"};
|
||||
static const option data_directory_option = {"-dd", "--data_directory"};
|
||||
static const option encrypt_option = {"-en", "--encrypt"};
|
||||
static const option drive_information_option = {"-di", "--drive_information"};
|
||||
static const option name_option = {"-na", "--name"};
|
||||
static const option s3_option = {"-s3", "--s3"};
|
||||
static const option generate_config_option = {"-gc", "--generate_config"};
|
||||
static const option get_option = {"-get", "--get"};
|
||||
static const option get_directory_items_option = {"-gdi",
|
||||
inline const option check_version_option = {"-cv", "--check_version"};
|
||||
inline const option display_config_option = {"-dc", "--display_config"};
|
||||
inline const option data_directory_option = {"-dd", "--data_directory"};
|
||||
inline const option encrypt_option = {"-en", "--encrypt"};
|
||||
inline const option drive_information_option = {"-di", "--drive_information"};
|
||||
inline const option name_option = {"-na", "--name"};
|
||||
inline const option s3_option = {"-s3", "--s3"};
|
||||
inline const option generate_config_option = {"-gc", "--generate_config"};
|
||||
inline const option get_option = {"-get", "--get"};
|
||||
inline const option get_directory_items_option = {"-gdi",
|
||||
"--get_directory_items"};
|
||||
static const option get_pinned_files_option = {"-gpf", "--get_pinned_files"};
|
||||
static const option help_option = {"-h", "--help"};
|
||||
static const option hidden_option = {"-hidden", "--hidden"};
|
||||
static const option open_files_option = {"-of", "--open_files"};
|
||||
static const option pin_file_option = {"-pf", "--pin_file"};
|
||||
static const option pinned_status_option = {"-ps", "--pinned_status"};
|
||||
static const option password_option = {"-pw", "--password"};
|
||||
static const option remote_mount_option = {"-rm", "--remote_mount"};
|
||||
static const option set_option = {"-set", "--set"};
|
||||
static const option status_option = {"-status", "--status"};
|
||||
static const option test_option = {"-test", "--test"};
|
||||
static const option ui_option = {"-ui", "--ui"};
|
||||
static const option ui_port_option = {"-up", "--ui_port"};
|
||||
static const option unmount_option = {"-unmount", "--unmount"};
|
||||
static const option unpin_file_option = {"-uf", "--unpin_file"};
|
||||
static const option user_option = {"-us", "--user"};
|
||||
static const option version_option = {"-V", "--version"};
|
||||
inline const option get_pinned_files_option = {"-gpf", "--get_pinned_files"};
|
||||
inline const option help_option = {"-h", "--help"};
|
||||
inline const option hidden_option = {"-hidden", "--hidden"};
|
||||
inline const option open_files_option = {"-of", "--open_files"};
|
||||
inline const option pin_file_option = {"-pf", "--pin_file"};
|
||||
inline const option pinned_status_option = {"-ps", "--pinned_status"};
|
||||
inline const option password_option = {"-pw", "--password"};
|
||||
inline const option remote_mount_option = {"-rm", "--remote_mount"};
|
||||
inline const option set_option = {"-set", "--set"};
|
||||
inline const option status_option = {"-status", "--status"};
|
||||
inline const option test_option = {"-test", "--test"};
|
||||
inline const option ui_option = {"-ui", "--ui"};
|
||||
inline const option ui_port_option = {"-up", "--ui_port"};
|
||||
inline const option unmount_option = {"-unmount", "--unmount"};
|
||||
inline const option unpin_file_option = {"-uf", "--unpin_file"};
|
||||
inline const option user_option = {"-us", "--user"};
|
||||
inline const option version_option = {"-V", "--version"};
|
||||
|
||||
static const std::vector<option> option_list = {
|
||||
inline const std::vector<option> option_list = {
|
||||
check_version_option,
|
||||
display_config_option,
|
||||
data_directory_option,
|
||||
|
@@ -27,7 +27,7 @@
|
||||
namespace repertory::utils::error {
|
||||
void raise_error(std::string_view function, std::string_view msg);
|
||||
|
||||
void raise_error(std::string_view function, const api_error &err,
|
||||
void raise_error(std::string_view function, api_error err,
|
||||
std::string_view msg);
|
||||
|
||||
void raise_error(std::string_view function, const std::exception &exception);
|
||||
@@ -41,7 +41,7 @@ void raise_error(std::string_view function, std::int64_t err,
|
||||
void raise_error(std::string_view function, const json &err,
|
||||
std::string_view msg);
|
||||
|
||||
void raise_error(std::string_view function, const api_error &err,
|
||||
void raise_error(std::string_view function, api_error err,
|
||||
std::string_view file_path, std::string_view msg);
|
||||
|
||||
void raise_error(std::string_view function, std::int64_t err,
|
||||
@@ -51,7 +51,7 @@ void raise_error(std::string_view function, const std::exception &exception,
|
||||
std::string_view file_path, std::string_view msg);
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
const api_error &err, std::string_view msg);
|
||||
api_error err, std::string_view msg);
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
const std::exception &exception);
|
||||
@@ -67,7 +67,7 @@ void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
const json &err, std::string_view msg);
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
std::string_view source_path, const api_error &err,
|
||||
std::string_view source_path, api_error err,
|
||||
std::string_view msg);
|
||||
|
||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user