66 Commits

Author SHA1 Message Date
9cb3cdabb0 cleanup
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-31 14:49:26 -06:00
6cf082dfa7 refactor 2024-12-31 14:45:52 -06:00
1a140d4dfd refactor 2024-12-31 14:45:11 -06:00
1cc8571a04 refactor 2024-12-31 14:42:57 -06:00
cf8c631938 refactor 2024-12-31 14:42:24 -06:00
4cba2a16f9 updated CHANGELOG.md 2024-12-31 14:29:55 -06:00
7c5f074d5a [bug] Address slow directory responses in S3 mounts for deep nested directories #28 2024-12-31 14:22:55 -06:00
a251cf6abf exception handling 2024-12-31 13:42:50 -06:00
31f7a47889 exception handling 2024-12-31 13:41:38 -06:00
23de2af98d exception handling 2024-12-31 13:41:00 -06:00
2446f024ef exception handling 2024-12-31 13:39:29 -06:00
45ddd528b2 exception handling 2024-12-31 13:37:55 -06:00
36908f7da9 [bug] Sia provider error responses are not being logged #30 2024-12-31 13:34:08 -06:00
1a11d55782 updated CHANGELOG.md 2024-12-31 13:20:50 -06:00
e344eddbcb [bug] Sia provider error responses are not being logged #30 2024-12-31 13:19:42 -06:00
09da7a29a9 [bug] Sia provider error responses are not being logged #30 2024-12-31 13:13:17 -06:00
5b5ac0937c [bug] Sia provider error responses are not being logged #30 2024-12-31 13:12:49 -06:00
c69818fed6 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 12:56:13 -06:00
81712e7a99 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 12:55:52 -06:00
75d2d39e7c refactor 2024-12-31 12:53:08 -06:00
ccc4a30ad5 spelling 2024-12-31 11:35:27 -06:00
a9bb12015a fix missing request headers 2024-12-31 11:32:47 -06:00
474f90ee33 fix missing request headers 2024-12-31 11:31:03 -06:00
ae7d5fe284 fix missing request headers 2024-12-31 11:29:05 -06:00
bf700b9d59 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 11:05:20 -06:00
0d4b3f5e7e [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 10:55:33 -06:00
67076458f0 updated CHANGELOG.md 2024-12-31 10:28:57 -06:00
a8479eefd1 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 10:22:49 -06:00
e1eda99a72 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 10:15:21 -06:00
ed4a4f0742 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 10:14:13 -06:00
84e89d3b83 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 09:50:20 -06:00
5e3efde376 [bug] S3 provider should limit max key size to 1024 #31 2024-12-31 09:39:20 -06:00
f28e17f3e5 updated CHANGELOG.md 2024-12-31 08:53:55 -06:00
699ecafc22 updated CHANGELOG.md 2024-12-31 08:53:00 -06:00
247cc301ea [bug] S3 error responses are not being logged #29 2024-12-31 08:47:28 -06:00
bc43338127 [bug] S3 error responses are not being logged #29 2024-12-31 08:46:17 -06:00
4e86f2a7de refactor 2024-12-31 08:42:22 -06:00
b9fe2746e3 refactor 2024-12-31 08:31:36 -06:00
4fe9d09f0a updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-30 19:37:41 -06:00
777db300e1 fix
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-30 18:44:21 -06:00
62a303e856 [bug] Address slow directory responses in S3 mounts for deep nested directories #28
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
[bug] S3 error responses are not being logged #29
2024-12-30 12:09:52 -06:00
ae573af89d updated CHANGELOG.md
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-29 17:49:12 -06:00
0c41a3309e fix invalid error
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2024-12-29 17:43:09 -06:00
4cb3e22308 moved event to debug
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2024-12-29 14:44:19 -06:00
9d7d36922f updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-29 12:18:01 -06:00
3190c5f133 updated build system
Some checks are pending
BlockStorage/repertory/pipeline/head Build queued...
2024-12-29 12:04:17 -06:00
5fadb796d1 fix CHANGELOG.md
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2024-12-29 09:57:29 -06:00
4a213e5ca5 updated CHANGELOG.md 2024-12-29 09:57:14 -06:00
9fea962563 updated CHANGELOG.md 2024-12-29 09:43:54 -06:00
ac6c333df3 updated CHANGELOG.md 2024-12-29 09:41:37 -06:00
4bbff47b6f updated build system 2024-12-29 09:21:56 -06:00
f01daa4296 [Unit Test] Complete FUSE unit tests #22
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-29 07:09:49 -06:00
96c2f8ee1e [Unit Test] Complete FUSE unit tests #22 2024-12-29 07:08:25 -06:00
9eb3e7a22d [Unit Test] Complete FUSE unit tests #22 2024-12-29 07:06:19 -06:00
3c2c783683 [Unit Test] Complete FUSE unit tests #22 2024-12-29 06:41:55 -06:00
2e24f9bb44 updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
2024-12-28 22:23:27 -06:00
6bb3351cb8 fix deliver script
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2024-12-28 22:08:24 -06:00
6086a0ea12 cleanup 2024-12-28 19:36:25 -06:00
b4b688d3b9 refactor 2024-12-28 19:35:17 -06:00
43bf3c0cb2 refactor 2024-12-28 19:33:42 -06:00
26897c256b call shutdown before close 2024-12-28 19:31:02 -06:00
a788563db6 cleanup 2024-12-28 19:27:36 -06:00
9fb1c747a6 updated CHANGELOG.md
Some checks failed
BlockStorage/repertory/pipeline/head There was a failure building this commit
2024-12-28 16:30:32 -06:00
5982978879 updated CHANGELOG.md
Some checks reported errors
BlockStorage/repertory/pipeline/head Something is wrong with the build of this commit
2024-12-28 16:25:22 -06:00
5ca4584416 updated copyright 2024-12-28 16:20:41 -06:00
3eca1af971 updated version 2024-12-28 16:04:38 -06:00
314 changed files with 1456 additions and 1242 deletions

View File

@@ -26,6 +26,7 @@ cppvsdbg
create_notraverse create_notraverse
crypto_aead_xchacha20poly1305_ietf_npubbytes crypto_aead_xchacha20poly1305_ietf_npubbytes
cstdint cstdint
curlopt_aws_sigv4
cxxflags cxxflags
cxxstd cxxstd
d_largefile64_source d_largefile64_source
@@ -154,6 +155,7 @@ nlohmann_json
nmakeprg nmakeprg
nominmax nominmax
ntstatus ntstatus
nullptr
nuspell_version nuspell_version
oleaut32 oleaut32
openal_version openal_version

View File

@@ -1,14 +1,35 @@
# Changelog # Changelog
## v2.0.3-rc
### Issues
* ~~\#12 \[Unit Test\] Complete all providers unit tests~~
* ~~\#20 Add support to evict open files~~
* ~~\#21 \[Unit Test \] Complete WinFSP unit tests~~
* ~~\#22 \[Unit Test\] Complete FUSE unit tests~~
* ~~\#28 \[bug\] Address slow directory responses in S3 mounts for deeply nested directories~~
* \#29 \[bug\] S3 error responses are not being logged
* \#30 \[bug\] Sia provider error responses are not logged
* ~~\#31 \[bug\] S3 provider should limit max key size to 1024~~
### Changes from v2.0.2-rc
* Updated build system to Alpine 3.21.0
* Updated build system to MinGW-w64 12.0.0
* Updated copyright to 2018-2025
* Fixed invalid directory nullptr error on remote mounts
* Fixed http headers not being added for requests
## v2.0.2-rc ## v2.0.2-rc
### BREAKING CHANGES ### BREAKING CHANGES
* Refactored `config.json` - will need to verify configuration settings prior to mounting * Refactored `config.json` - will need to verify configuration settings prior to mounting
<!-- markdownlint-disable-next-line -->
### Issues ### Issues
* \#12 \[Unit Test\] Complete all providers unit tests
* \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup * \#14 \[Unit Test\] SQLite mini-ORM unit tests and cleanup
* \#16 Add support for bucket name in Sia provider * \#16 Add support for bucket name in Sia provider
* \#17 Update to common c++ build system * \#17 Update to common c++ build system

View File

@@ -1,5 +1,5 @@
# Repertory MIT License # Repertory MIT License
### Copyright <2018-2024> <scott.e.graves@protonmail.com> ### 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: 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:

View File

@@ -1,15 +1,15 @@
set(BINUTILS_HASH ae9a5789e23459e59606e6714723f2d3ffc31c03174191ef0d015bdf06007450) set(BINUTILS_HASH b53606f443ac8f01d1d5fc9c39497f2af322d99e14cea5c0b4b124d630379365)
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca) set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
set(BOOST_HASH f55c340aa49763b1925ccf02b2e83f35fdcf634c9d5164a2acb87540173c741d)
set(CPP_HTTPLIB_HASH 405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00) set(CPP_HTTPLIB_HASH 405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00)
set(CURL_HASH 5a231145114589491fc52da118f9c7ef8abee885d1cb1ced99c7290e9a352f07) set(CURL_HASH 5a231145114589491fc52da118f9c7ef8abee885d1cb1ced99c7290e9a352f07)
set(EXPAT_HASH 372b18f6527d162fa9658f1c74d22a37429b82d822f5a1e1fc7e00f6045a06a2) set(EXPAT_HASH 372b18f6527d162fa9658f1c74d22a37429b82d822f5a1e1fc7e00f6045a06a2)
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293) set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
set(GTEST_HASH 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926) set(GTEST_HASH 7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926)
set(ICU_HASH 925e6b4b8cf8856e0ac214f6f34e30dee63b7bb7a50460ab4603950eff48f89e) set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
set(JSON_HASH 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406) set(JSON_HASH 0d8ef5af7f9794e3263480193c491549b2ba6cc74bb018906202ada498a79406)
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1) set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
set(MINGW_HASH 3f66bce069ee8bed7439a1a13da7cb91a5e67ea6170f21317ac7f5794625ee10) set(MINGW_HASH 30e5aad2c48dd318150f79cff47661232c4175876d6b4d6b270961cf2b49a48b)
set(OPENSSL_HASH e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf) set(OPENSSL_HASH e15dda82fe2fe8139dc2ac21a36d4ca01d5313c75f99f46c4e8a27709b7294bf)
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591) set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
set(PUGIXML_HASH 2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015) set(PUGIXML_HASH 2f10e276870c64b1db6809050a75e11a897a8d7456c4be5c6b2e35a11168a015)

View File

@@ -20,11 +20,13 @@ if(PROJECT_ENABLE_CURL)
LIST_SEPARATOR | LIST_SEPARATOR |
CMAKE_ARGS CMAKE_ARGS
${PROJECT_EXTERNAL_CMAKE_FLAGS} ${PROJECT_EXTERNAL_CMAKE_FLAGS}
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_LIBS=ON
-DBUILD_CURL_EXE=OFF -DBUILD_CURL_EXE=OFF
-DBUILD_LIBCURL_DOCS=OFF
-DBUILD_MISC_DOCS=OFF
-DBUILD_SHARED_LIBS=${PROJECT_BUILD_SHARED_LIBS}
-DBUILD_STATIC_CURL=ON -DBUILD_STATIC_CURL=ON
-DBUILD_STATIC_LIBS=ON -DBUILD_STATIC_LIBS=ON
-DBUILD_STATIC_LIBS=ON
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
-DCURL_CA_BUNDLE=./cacert.pem -DCURL_CA_BUNDLE=./cacert.pem
-DCURL_CA_FALLBACK=ON -DCURL_CA_FALLBACK=ON
@@ -33,6 +35,7 @@ if(PROJECT_ENABLE_CURL)
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH2=OFF
-DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL} -DCURL_USE_OPENSSL=${PROJECT_ENABLE_OPENSSL}
-DCURL_ZLIB=ON -DCURL_ZLIB=ON
-DENABLE_CURL_MANUAL=OFF
-DENABLE_THREADED_RESOLVER=ON -DENABLE_THREADED_RESOLVER=ON
-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR} -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
-DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS} -DOPENSSL_USE_STATIC_LIBS=${OPENSSL_USE_STATIC_LIBS}

View File

@@ -1,4 +1,4 @@
set(BINUTILS_VERSION 2.41) set(BINUTILS_VERSION 2.43)
set(BOOST2_MAJOR_VERSION 1) set(BOOST2_MAJOR_VERSION 1)
set(BOOST2_MINOR_VERSION 76) set(BOOST2_MINOR_VERSION 76)
set(BOOST2_PATCH_VERSION 0) set(BOOST2_PATCH_VERSION 0)
@@ -12,11 +12,11 @@ set(EXPAT2_VERSION 2_6_4)
set(EXPAT_VERSION 2.6.4) set(EXPAT_VERSION 2.6.4)
set(GCC_VERSION 14.2.0) set(GCC_VERSION 14.2.0)
set(GTEST_VERSION 1.15.2) set(GTEST_VERSION 1.15.2)
set(ICU_VERSION 75-1) set(ICU_VERSION 76-1)
set(JSON_VERSION 3.11.3) set(JSON_VERSION 3.11.3)
set(LIBSODIUM_VERSION 1.0.20) set(LIBSODIUM_VERSION 1.0.20)
set(MESA_VERSION 23.3.3) set(MESA_VERSION 23.3.3)
set(MINGW_VERSION 11.0.1) set(MINGW_VERSION 12.0.0)
set(OPENSSL_VERSION 3.4.0) set(OPENSSL_VERSION 3.4.0)
set(PKG_CONFIG_VERSION 0.29.2) set(PKG_CONFIG_VERSION 0.29.2)
set(PUGIXML_VERSION 1.14) set(PUGIXML_VERSION 1.14)

View File

@@ -5,12 +5,12 @@ PROJECT_NAME="repertory"
PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage" PROJECT_COMPANY_NAME="https://git.fifthgrid.com/blockstorage"
PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory" PROJECT_URL="${PROJECT_COMPANY_NAME}/repertory"
PROJECT_COPYRIGHT="Copyright <2018-2024> <MIT License> <${PROJECT_URL}>" PROJECT_COPYRIGHT="Copyright <2018-2025> <MIT License> <${PROJECT_URL}>"
PROJECT_DESC="Mount utility for Sia and S3" PROJECT_DESC="Mount utility for Sia and S3"
PROJECT_MAJOR_VERSION=2 PROJECT_MAJOR_VERSION=2
PROJECT_MINOR_VERSION=0 PROJECT_MINOR_VERSION=0
PROJECT_REVISION_VERSION=2 PROJECT_REVISION_VERSION=3
PROJECT_RELEASE_NUM=0 PROJECT_RELEASE_NUM=0
PROJECT_RELEASE_ITER=rc PROJECT_RELEASE_ITER=rc

View File

@@ -1,4 +1,4 @@
FROM arm64v8/alpine:3.20.3 FROM arm64v8/alpine:3.21.0
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com> MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
CMD bash CMD bash
@@ -30,7 +30,6 @@ RUN apk add \
gflags \ gflags \
gflags-dev \ gflags-dev \
git \ git \
gtkmm3-dev \
icu-dev \ icu-dev \
icu-libs \ icu-libs \
icu-static \ icu-static \
@@ -69,7 +68,6 @@ RUN apk add \
tcl \ tcl \
tcl-dev \ tcl-dev \
texinfo \ texinfo \
vlc-dev \
wget \ wget \
xz \ xz \
xz-dev \ xz-dev \
@@ -82,3 +80,6 @@ RUN apk add \
zstd-libs \ zstd-libs \
zstd-static \ zstd-static \
xz-static xz-static
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16

View File

@@ -1,4 +1,4 @@
FROM alpine:3.20.3 FROM alpine:3.21.0
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com> MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
CMD bash CMD bash
@@ -80,3 +80,6 @@ RUN apk add \
zstd-libs \ zstd-libs \
zstd-static \ zstd-static \
xz-static xz-static
RUN ln -sf /usr/bin/aclocal-1.17 /usr/bin/aclocal-1.16
RUN ln -sf /usr/bin/automake-1.17 /usr/bin/automake-1.16

View File

@@ -1,5 +1,5 @@
#comment #comment
FROM alpine:3.20.3 FROM alpine:3.21.0
RUN apk update RUN apk update
RUN apk upgrade RUN apk upgrade
@@ -671,6 +671,8 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
&& cd build \ && cd build \
&& cmake .. \ && cmake .. \
-DBUILD_CURL_EXE=ON \ -DBUILD_CURL_EXE=ON \
-DBUILD_LIBCURL_DOCS=OFF \
-DBUILD_MISC_DOCS=OFF \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=ON \ -DBUILD_STATIC_LIBS=ON \
-DBUILD_TESTING=OFF \ -DBUILD_TESTING=OFF \
@@ -684,6 +686,7 @@ RUN if [ -f "/3rd_party/curl-${MY_CURL_VERSION}.tar.gz" ]; then \
-DCURL_USE_LIBSSH2=OFF \ -DCURL_USE_LIBSSH2=OFF \
-DCURL_USE_OPENSSL=ON \ -DCURL_USE_OPENSSL=ON \
-DCURL_ZLIB=ON \ -DCURL_ZLIB=ON \
-DENABLE_CURL_MANUAL=OFF \
-DENABLE_THREADED_RESOLVER=ON \ -DENABLE_THREADED_RESOLVER=ON \
-DOPENSSL_USE_STATIC_LIBS=ON \ -DOPENSSL_USE_STATIC_LIBS=ON \
-DUSE_LIBIDN2=OFF \ -DUSE_LIBIDN2=OFF \

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -61,13 +61,14 @@ public:
[[nodiscard]] static auto reset_curl(CURL *curl_handle) -> CURL *; [[nodiscard]] static auto reset_curl(CURL *curl_handle) -> CURL *;
public: public:
[[nodiscard]] static auto [[nodiscard]] static auto construct_url(CURL *curl,
construct_url(CURL *curl, const std::string &relative_path, const std::string &relative_path,
const host_config &cfg) -> std::string; const host_config &cfg)
-> std::string;
[[nodiscard]] static auto [[nodiscard]] static auto create_host_config(const s3_config &cfg,
create_host_config(const s3_config &cfg, bool use_s3_path_style)
bool use_s3_path_style) -> host_config; -> host_config;
[[nodiscard]] static auto url_encode(CURL *curl, const std::string &data, [[nodiscard]] static auto url_encode(CURL *curl, const std::string &data,
bool allow_slash) -> std::string; bool allow_slash) -> std::string;
@@ -75,8 +76,8 @@ public:
template <typename request_type> template <typename request_type>
[[nodiscard]] static auto [[nodiscard]] static auto
make_encrypted_request(const host_config &cfg, const request_type &request, make_encrypted_request(const host_config &cfg, const request_type &request,
long &response_code, long &response_code, stop_type &stop_requested)
stop_type &stop_requested) -> bool { -> bool {
response_code = 0; response_code = 0;
if (not request.decryption_token.has_value() || if (not request.decryption_token.has_value() ||
@@ -193,6 +194,16 @@ public:
request.aws_service.value().c_str()); 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; auto url = construct_url(curl, request.get_path(), cfg) + parameters;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
@@ -200,6 +211,11 @@ public:
CURLcode curl_code{}; CURLcode curl_code{};
curl_request.get_result(curl_code, response_code); curl_request.get_result(curl_code, response_code);
if (header_list != nullptr) {
curl_slist_free_all(header_list);
}
if (curl_code != CURLE_OK) { if (curl_code != CURLE_OK) {
event_system::instance().raise<curl_error>(url, curl_code); event_system::instance().raise<curl_error>(url, curl_code);
return false; return false;
@@ -215,26 +231,30 @@ public:
public: public:
void enable_s3_path_style(bool enable) override; void enable_s3_path_style(bool enable) override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_delete &del,
make_request(const curl::requests::http_delete &del, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_get &get,
make_request(const curl::requests::http_get &get, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_head &head,
make_request(const curl::requests::http_head &head, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_post &post_file,
make_request(const curl::requests::http_post &post_file, long &response_code, long &response_code,
stop_type &stop_requested) const -> bool override; stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto [[nodiscard]] auto make_request(const curl::requests::http_put_file &put_file,
make_request(const curl::requests::http_put_file &put_file, long &response_code,
long &response_code, stop_type &stop_requested) const
stop_type &stop_requested) const -> bool override; -> bool override;
}; };
} // namespace repertory } // namespace repertory

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -32,15 +32,15 @@ struct http_post final : http_request_base {
auto operator=(const http_post &) -> http_post & = default; auto operator=(const http_post &) -> http_post & = default;
auto operator=(http_post &&) -> http_post & = default; auto operator=(http_post &&) -> http_post & = default;
~http_post() override; ~http_post() override = default;
std::optional<nlohmann::json> json; std::optional<nlohmann::json> json;
[[nodiscard]] auto [[nodiscard]] auto set_method(CURL *curl,
set_method(CURL *curl, stop_type & /*stop_requested*/) const -> bool override; stop_type & /*stop_requested*/) const
-> bool override;
private: private:
mutable curl_slist *headers{nullptr};
mutable std::optional<std::string> json_str; mutable std::optional<std::string> json_str;
}; };
} // namespace repertory::curl::requests } // namespace repertory::curl::requests

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -51,7 +51,7 @@ struct http_request_base {
bool allow_timeout{}; bool allow_timeout{};
std::optional<std::string> aws_service; std::optional<std::string> aws_service;
std::optional<std::string> decryption_token{}; std::optional<std::string> decryption_token{};
http_headers headers{}; mutable http_headers headers{};
std::string path{}; std::string path{};
http_query_parameters query{}; http_query_parameters query{};
std::optional<http_range> range{}; std::optional<http_range> range{};

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -69,21 +69,21 @@ private:
void put_client(std::shared_ptr<client> &cli); void put_client(std::shared_ptr<client> &cli);
[[nodiscard]] auto read_packet(client &cli, packet &response) [[nodiscard]] auto read_packet(client &cli,
-> packet::error_type; packet &response) const -> packet::error_type;
void resolve(); void resolve();
public: public:
[[nodiscard]] auto send(std::string_view method, std::uint32_t &service_flags) [[nodiscard]] auto send(std::string_view method,
-> packet::error_type; std::uint32_t &service_flags) -> packet::error_type;
[[nodiscard]] auto send(std::string_view method, packet &request, [[nodiscard]] auto send(std::string_view method, packet &request,
std::uint32_t &service_flags) -> packet::error_type; std::uint32_t &service_flags) -> packet::error_type;
[[nodiscard]] auto send(std::string_view method, packet &request, [[nodiscard]] auto send(std::string_view method, packet &request,
packet &response, std::uint32_t &service_flags) packet &response,
-> packet::error_type; std::uint32_t &service_flags) -> packet::error_type;
}; };
} // namespace repertory } // namespace repertory

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -221,25 +221,44 @@ using WCHAR = wchar_t;
#define MAX_PATH 260 #define MAX_PATH 260
#define STATUS_SUCCESS std::uint32_t{0U} #define STATUS_SUCCESS \
#define STATUS_ACCESS_DENIED std::uint32_t{0xC0000022L} std::uint32_t { 0U }
#define STATUS_DEVICE_BUSY std::uint32_t{0x80000011L} #define STATUS_ACCESS_DENIED \
#define STATUS_DEVICE_INSUFFICIENT_RESOURCES std::uint32_t{0xC0000468L} std::uint32_t { 0xC0000022L }
#define STATUS_DIRECTORY_NOT_EMPTY std::uint32_t{0xC0000101L} #define STATUS_DEVICE_BUSY \
#define STATUS_FILE_IS_A_DIRECTORY std::uint32_t{0xC00000BAL} std::uint32_t { 0x80000011L }
#define STATUS_FILE_TOO_LARGE std::uint32_t{0xC0000904L} #define STATUS_DEVICE_INSUFFICIENT_RESOURCES \
#define STATUS_INSUFFICIENT_RESOURCES std::uint32_t{0xC000009AL} std::uint32_t { 0xC0000468L }
#define STATUS_INTERNAL_ERROR std::uint32_t{0xC00000E5L} #define STATUS_DIRECTORY_NOT_EMPTY \
#define STATUS_INVALID_ADDRESS std::uint32_t{0xC0000141L} std::uint32_t { 0xC0000101L }
#define STATUS_INVALID_HANDLE std::uint32_t{0xC0000006L} #define STATUS_FILE_IS_A_DIRECTORY \
#define STATUS_INVALID_IMAGE_FORMAT std::uint32_t{0xC000007BL} std::uint32_t { 0xC00000BAL }
#define STATUS_INVALID_PARAMETER std::uint32_t{0xC000000DL} #define STATUS_FILE_TOO_LARGE \
#define STATUS_NO_MEMORY std::uint32_t{0xC0000017L} std::uint32_t { 0xC0000904L }
#define STATUS_NOT_IMPLEMENTED std::uint32_t{0xC0000002L} #define STATUS_INSUFFICIENT_RESOURCES \
#define STATUS_OBJECT_NAME_EXISTS std::uint32_t{0x40000000L} std::uint32_t { 0xC000009AL }
#define STATUS_OBJECT_NAME_NOT_FOUND std::uint32_t{0xC0000034L} #define STATUS_INTERNAL_ERROR \
#define STATUS_OBJECT_PATH_INVALID std::uint32_t{0xC0000039L} std::uint32_t { 0xC00000E5L }
#define STATUS_UNEXPECTED_IO_ERROR std::uint32_t{0xC00000E9L} #define STATUS_INVALID_ADDRESS \
std::uint32_t { 0xC0000141L }
#define STATUS_INVALID_HANDLE \
std::uint32_t { 0xC0000006L }
#define STATUS_INVALID_IMAGE_FORMAT \
std::uint32_t { 0xC000007BL }
#define STATUS_INVALID_PARAMETER \
std::uint32_t { 0xC000000DL }
#define STATUS_NO_MEMORY \
std::uint32_t { 0xC0000017L }
#define STATUS_NOT_IMPLEMENTED \
std::uint32_t { 0xC0000002L }
#define STATUS_OBJECT_NAME_EXISTS \
std::uint32_t { 0x40000000L }
#define STATUS_OBJECT_NAME_NOT_FOUND \
std::uint32_t { 0xC0000034L }
#define STATUS_OBJECT_PATH_INVALID \
std::uint32_t { 0xC0000039L }
#define STATUS_UNEXPECTED_IO_ERROR \
std::uint32_t { 0xC00000E9L }
#define CONVERT_STATUS_NOT_IMPLEMENTED(e) \ #define CONVERT_STATUS_NOT_IMPLEMENTED(e) \
((std::uint32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e) ((std::uint32_t(e) == STATUS_NOT_IMPLEMENTED) ? -ENOTSUP : e)

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -51,35 +51,35 @@ public:
[[nodiscard]] virtual auto add_upload(const upload_entry &entry) -> bool = 0; [[nodiscard]] virtual auto add_upload(const upload_entry &entry) -> bool = 0;
[[nodiscard]] virtual auto add_upload_active(const upload_active_entry &entry) [[nodiscard]] virtual auto
-> bool = 0; add_upload_active(const upload_active_entry &entry) -> bool = 0;
virtual void clear() = 0; virtual void clear() = 0;
[[nodiscard]] virtual auto get_next_upload() const [[nodiscard]] virtual auto
-> std::optional<upload_entry> = 0; get_next_upload() const -> std::optional<upload_entry> = 0;
[[nodiscard]] virtual auto get_resume_list() const [[nodiscard]] virtual auto
-> std::vector<resume_entry> = 0; get_resume_list() const -> std::vector<resume_entry> = 0;
[[nodiscard]] virtual auto get_upload(const std::string &api_path) const [[nodiscard]] virtual auto get_upload(const std::string &api_path) const
-> std::optional<upload_entry> = 0; -> std::optional<upload_entry> = 0;
[[nodiscard]] virtual auto get_upload_active_list() const [[nodiscard]] virtual auto
-> std::vector<upload_active_entry> = 0; get_upload_active_list() const -> std::vector<upload_active_entry> = 0;
[[nodiscard]] virtual auto remove_resume(const std::string &api_path) [[nodiscard]] virtual auto
-> bool = 0; remove_resume(const std::string &api_path) -> bool = 0;
[[nodiscard]] virtual auto remove_upload(const std::string &api_path) [[nodiscard]] virtual auto
-> bool = 0; remove_upload(const std::string &api_path) -> bool = 0;
[[nodiscard]] virtual auto remove_upload_active(const std::string &api_path) [[nodiscard]] virtual auto
-> bool = 0; remove_upload_active(const std::string &api_path) -> bool = 0;
[[nodiscard]] virtual auto rename_resume(const std::string &from_api_path, [[nodiscard]] virtual auto
const std::string &to_api_path) rename_resume(const std::string &from_api_path,
-> bool = 0; const std::string &to_api_path) -> bool = 0;
}; };
} // namespace repertory } // namespace repertory

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -60,10 +60,10 @@ public:
void execute_action(const std::string &api_path, void execute_action(const std::string &api_path,
const execute_callback &execute); const execute_callback &execute);
[[nodiscard]] auto get_directory(std::uint64_t handle) [[nodiscard]] auto
-> std::shared_ptr<directory_iterator>; get_directory(std::uint64_t handle) -> std::shared_ptr<directory_iterator>;
[[nodiscard]] auto remove_directory(const std::string &api_path) auto remove_directory(const std::string &api_path)
-> std::shared_ptr<directory_iterator>; -> std::shared_ptr<directory_iterator>;
void remove_directory(std::uint64_t handle); void remove_directory(std::uint64_t handle);

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -39,7 +39,7 @@ E_SIMPLE3(debug_log, debug, true,
std::string, data, data, E_FROM_STRING std::string, data, data, E_FROM_STRING
); );
E_SIMPLE1(directory_removed, info, true, E_SIMPLE1(directory_removed, debug, true,
std::string, api_path, ap, E_FROM_STRING std::string, api_path, ap, E_FROM_STRING
); );

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -54,14 +54,14 @@ private:
const std::string &object_name) const const std::string &object_name) const
-> api_error; -> api_error;
[[nodiscard]] auto create_directory_paths(const std::string &api_path,
const std::string &key) const
-> api_error;
[[nodiscard]] auto create_file_extra(const std::string &api_path, [[nodiscard]] auto create_file_extra(const std::string &api_path,
api_meta_map &meta) api_meta_map &meta)
-> api_error override; -> api_error override;
[[nodiscard]] auto create_path_directories(const std::string &api_path,
const std::string &key) const
-> api_error;
[[nodiscard]] auto decrypt_object_name(std::string &object_name) const [[nodiscard]] auto decrypt_object_name(std::string &object_name) const
-> api_error; -> api_error;

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -41,9 +41,6 @@ private:
std::atomic<bool> started_ = false; std::atomic<bool> started_ = false;
private: private:
// [[nodiscard]] bool check_authorization(const httpserver::http_request
// &request);
[[nodiscard]] auto check_authorization(const httplib::Request &req) -> bool; [[nodiscard]] auto check_authorization(const httplib::Request &req) -> bool;
void handle_get_config(const httplib::Request &req, httplib::Response &res); void handle_get_config(const httplib::Request &req, httplib::Response &res);

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -41,6 +41,7 @@ constexpr const auto default_task_wait_ms{100U};
constexpr const auto default_timeout_ms{60000U}; constexpr const auto default_timeout_ms{60000U};
constexpr const auto max_orphaned_file_retention_days{std::uint16_t(31U)}; constexpr const auto max_orphaned_file_retention_days{std::uint16_t(31U)};
constexpr const auto max_ring_buffer_file_size{std::uint16_t(1024U)}; 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{ constexpr const auto min_cache_size_bytes{
std::uint64_t(100UL * 1024UL * 1024UL)}; std::uint64_t(100UL * 1024UL * 1024UL)};
constexpr const auto min_download_timeout_secs{std::uint8_t(5U)}; constexpr const auto min_download_timeout_secs{std::uint8_t(5U)};
@@ -200,6 +201,7 @@ enum class api_error {
item_exists, item_exists,
item_not_found, item_not_found,
more_data, more_data,
name_too_long,
no_disk_space, no_disk_space,
not_implemented, not_implemented,
not_supported, not_supported,
@@ -216,31 +218,33 @@ enum class api_error {
[[nodiscard]] auto api_error_from_string(std::string_view str) -> api_error; [[nodiscard]] auto api_error_from_string(std::string_view str) -> api_error;
[[nodiscard]] auto [[nodiscard]] auto api_error_to_string(const api_error &error)
api_error_to_string(const api_error &error) -> const std::string &; -> const std::string &;
enum class database_type { enum class database_type {
rocksdb, rocksdb,
sqlite, sqlite,
}; };
[[nodiscard]] auto database_type_from_string(
std::string type,
database_type default_type = database_type::rocksdb) -> database_type;
[[nodiscard]] auto [[nodiscard]] auto
database_type_to_string(const database_type &type) -> std::string; database_type_from_string(std::string type,
database_type default_type = database_type::rocksdb)
-> database_type;
[[nodiscard]] auto database_type_to_string(const database_type &type)
-> std::string;
enum class download_type { enum class download_type {
default_, default_,
direct, direct,
ring_buffer, ring_buffer,
}; };
[[nodiscard]] auto download_type_from_string(
std::string type,
download_type default_type = download_type::default_) -> download_type;
[[nodiscard]] auto [[nodiscard]] auto
download_type_to_string(const download_type &type) -> std::string; download_type_from_string(std::string type,
download_type default_type = download_type::default_)
-> download_type;
[[nodiscard]] auto download_type_to_string(const download_type &type)
-> std::string;
enum class exit_code : std::int32_t { enum class exit_code : std::int32_t {
success = 0, success = 0,

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,5 +1,5 @@
/* /*
Copyright <2018-2024> <scott.e.graves@protonmail.com> Copyright <2018-2025> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,59 +0,0 @@
/*
Copyright <2018-2024> <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_UTILS_THROTTLE_HPP_
#define REPERTORY_INCLUDE_UTILS_THROTTLE_HPP_
namespace repertory {
class throttle final {
public:
throttle() : max_size_(10u) {}
explicit throttle(std::size_t max_size) : max_size_(max_size) {}
public:
throttle(const throttle &) noexcept = delete;
throttle(throttle &&) noexcept = delete;
auto operator=(const throttle &) -> throttle & = delete;
auto operator=(throttle &&) -> throttle & = delete;
public:
~throttle() { shutdown(); }
private:
const std::size_t max_size_;
std::size_t count_ = 0u;
bool shutdown_ = false;
std::mutex mutex_;
std::condition_variable notify_;
public:
void decrement();
void increment_or_wait();
void reset();
void shutdown();
};
} // namespace repertory
#endif // REPERTORY_INCLUDE_UTILS_THROTTLE_HPP_

Some files were not shown because too many files have changed in this diff Show More