Compare commits
157 Commits
v2.1.0-rc-
...
396863a551
Author | SHA1 | Date | |
---|---|---|---|
396863a551 | |||
626b9c0464 | |||
5a823f975c | |||
7cdc1c69e0 | |||
7292fc11cf | |||
34a49c1dfa | |||
176154e60d | |||
d86e40ab15 | |||
a09fd441d3 | |||
84e3cbe775 | |||
dd86ae3078 | |||
be8bfeda71 | |||
7e3eb2bc16 | |||
245b7a60d6 | |||
45a46650a2 | |||
3c8e1d5986 | |||
3c2d363a5e | |||
22e5df62b9 | |||
853bc76b58 | |||
b100ff75cc | |||
1fba3e129f | |||
315d1f1d72 | |||
bf11906434 | |||
6fe6ccbbfe | |||
1a02d89ab9 | |||
eaa95cf9d1 | |||
3e8284b851 | |||
f490842710 | |||
22eb7a44b4 | |||
de5eb1005c | |||
fcaade316f | |||
4d60b39ea1 | |||
539abc1d5b | |||
3502bf2189 | |||
5f50e0204a | |||
1880c50fd8 | |||
b8cb717772 | |||
0a747e7a62 | |||
7784284097 | |||
09208e53a2 | |||
61d8b6d054 | |||
9398f17b76 | |||
f4251fcc97 | |||
add21a5608 | |||
bcccc5c4b8 | |||
ef8b16077b | |||
25007b4242 | |||
e1690509e1 | |||
92d6633f44 | |||
528fd595ab | |||
4e418c8969 | |||
d664c6a884 | |||
430fc1a651 | |||
314ee5b664 | |||
9eb8b5e682 | |||
bd386314a4 | |||
aee2413440 | |||
307fcb3332 | |||
28fefca765 | |||
3e09adaba3 | |||
e01ed2c1b8 | |||
ece42df528 | |||
45080aa32f | |||
fb9c8c8bb6 | |||
7a3ce13db0 | |||
6945a16f78 | |||
1153598c62 | |||
2afa403c8c | |||
d09210d9c4 | |||
2ca2002423 | |||
011d32f9cf | |||
7487caca2a | |||
f921295dbd | |||
13b2ee6f7a | |||
144baf4371 | |||
c6ade2e5f7 | |||
fb89cc08ae | |||
f08870b03c | |||
711e3f73cf | |||
ebb620fdb2 | |||
fbf9c85d48 | |||
d5e0252ed3 | |||
06b79ffd2d | |||
690902b31d | |||
0bfe1e1ccd | |||
a8723a6b02 | |||
1d88d26d0a | |||
757c880616 | |||
d65bd6af35 | |||
b285478cc5 | |||
31cd5acaee | |||
65036f2957 | |||
2362300bba | |||
f61f3d5fa4 | |||
a2b8998f4a | |||
a4d53c1011 | |||
4b925c15c2 | |||
bbd82e3f0f | |||
37f2cbc78d | |||
1ad3704fa0 | |||
a6e70d93cb | |||
967324a368 | |||
69b31bfde8 | |||
8b4724a9c1 | |||
6a0d50bc66 | |||
69910bef4c | |||
8c298c84c5 | |||
47dea2cc38 | |||
d8b476e80a | |||
c86c6e2ec6 | |||
c397497eb7 | |||
f8803dfbf0 | |||
5d5cacc482 | |||
3ce4210d56 | |||
d109344544 | |||
ff746a7bec | |||
a613ec77ff | |||
00d3dd95a8 | |||
28d1789f04 | |||
0603463885 | |||
88398485e1 | |||
908e75c696 | |||
dab8c61f87 | |||
e0cf58b01e | |||
281d3758e0 | |||
dfa170022a | |||
52c2780283 | |||
c2dbfc970a | |||
6f9b1f8f08 | |||
078d603be9 | |||
983e47103b | |||
8d2024d34b | |||
4f2ee2ad99 | |||
533938bcef | |||
98edf33be4 | |||
a080c9ff86 | |||
e6cdcd74a1 | |||
573ae549be | |||
fca149f998 | |||
76e375c488 | |||
3f9322f659 | |||
c286d496c3 | |||
56ba0fcb83 | |||
dcafb104ea | |||
ab757dfd36 | |||
eec2d2e9a9 | |||
8c1c91e02b | |||
bb85015733 | |||
883de836c6 | |||
bf2bdd1b5d | |||
f1e82d8f9f | |||
f5c4aebdac | |||
f2f9e8fd15 | |||
2a673915af | |||
df3db38ae7 | |||
b0b69c6dd4 | |||
11b118a30f |
@@ -28,7 +28,6 @@ cppvsdbg
|
|||||||
create_notraverse
|
create_notraverse
|
||||||
crypto_aead_xchacha20poly1305_ietf_npubbytes
|
crypto_aead_xchacha20poly1305_ietf_npubbytes
|
||||||
cstdint
|
cstdint
|
||||||
curle_couldnt_resolve_host
|
|
||||||
curlopt_aws_sigv4
|
curlopt_aws_sigv4
|
||||||
cxxflags
|
cxxflags
|
||||||
cxxstd
|
cxxstd
|
||||||
@@ -201,7 +200,6 @@ secp256k1
|
|||||||
secur32
|
secur32
|
||||||
sfml_project
|
sfml_project
|
||||||
shlwapi
|
shlwapi
|
||||||
sigchld
|
|
||||||
skynet
|
skynet
|
||||||
source_subdir
|
source_subdir
|
||||||
spdlog
|
spdlog
|
||||||
|
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,16 +1,13 @@
|
|||||||
# Changelog
|
# 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
|
## v2.0.6-release
|
||||||
|
|
||||||
### Issues
|
### 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
|
* \#42 [bug] Remote mount directory listing on Windows connected to Linux is failing
|
||||||
* \#43 [bug] Directories are not importing properly for Sia
|
* \#43 [bug] Directories are not importing properly for Sia
|
||||||
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
|
* \#44 [bug] Windows-to-Linux remote mount ignores `CREATE_NEW`
|
||||||
@@ -22,13 +19,9 @@
|
|||||||
|
|
||||||
### Changes from v2.0.5-rc
|
### 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
|
* Drive letters in UI should always be lowercase
|
||||||
* Fixed WinFSP directory rename for non-empty directories
|
* Fixed WinFSP directory rename for non-empty directories
|
||||||
* Fixed segfault in UI due to incorrect `SIGCHLD` handling
|
|
||||||
* Migrated to v2 error handling
|
* Migrated to v2 error handling
|
||||||
* Upgraded WinFSP to v2.1 (2025)
|
|
||||||
|
|
||||||
## v2.0.5-rc
|
## v2.0.5-rc
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ on Windows.
|
|||||||
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v2.0.0+ for Sia support
|
* [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
|
* Linux requires `fusermount3`; otherwise, `repertory` must be manually compiled with `libfuse2` support
|
||||||
* Windows requires the following dependencies to be installed:
|
* Windows requires the following dependencies to be installed:
|
||||||
* [WinFSP 2025](https://github.com/winfsp/winfsp/releases/download/v2.1/winfsp-2.1.25156.msi)
|
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
|
||||||
|
|
||||||
### Supported Operating Systems
|
### Supported Operating Systems
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ in the `dist/` directory
|
|||||||
* [spdlog](https://github.com/gabime/spdlog)
|
* [spdlog](https://github.com/gabime/spdlog)
|
||||||
* [SQLite](https://www.sqlite.org)
|
* [SQLite](https://www.sqlite.org)
|
||||||
* [stduuid](https://github.com/mariusbancila/stduuid)
|
* [stduuid](https://github.com/mariusbancila/stduuid)
|
||||||
* [Storj](https://www.storj.io/)
|
* [Storj](https://storj.io/)
|
||||||
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
|
* [WinFSP - FUSE for Windows](https://github.com/billziss-gh/winfsp)
|
||||||
* [zlib](https://zlib.net/)
|
* [zlib](https://zlib.net/)
|
||||||
|
|
||||||
|
@@ -1,20 +1,20 @@
|
|||||||
set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
|
set(BINUTILS_HASH ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237)
|
||||||
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
set(BOOST2_HASH 7bd7ddceec1a1dfdcbdb3e609b60d01739c38390a5f956385a12f3122049f0ca)
|
||||||
set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
|
set(BOOST_HASH 3621533e820dcab1e8012afd583c0c73cf0f77694952b81352bf38c1488f9cb4)
|
||||||
set(CPP_HTTPLIB_HASH 410a1347ed6bcbcc4a19af8ed8ad3873fe9fa97731d52db845c4c78f3f9c31e6)
|
set(CPP_HTTPLIB_HASH 18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866)
|
||||||
set(CURL_HASH 2937cadde007aa3a52a17c21ac9153ea054700f37926d1d96602bf07e888c847)
|
set(CURL_HASH ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699)
|
||||||
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
|
set(EXPAT_HASH 85372797ff0673a8fc4a6be16466bb5a0ca28c0dcf3c6f7ac1686b4a3ba2aabb)
|
||||||
set(GCC_HASH 51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1)
|
set(GCC_HASH 7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293)
|
||||||
set(GTEST_HASH 65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c)
|
set(GTEST_HASH 78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399)
|
||||||
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
set(ICU_HASH a2c443404f00098e9e90acf29dc318e049d2dc78d9ae5f46efb261934a730ce2)
|
||||||
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
|
set(JSON_HASH 4b92eb0c06d10683f7447ce9406cb97cd4b453be18d7279320f7b2f025c10187)
|
||||||
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
set(LIBSODIUM_HASH 8e5aeca07a723a27bbecc3beef14b0068d37e7fc0e97f51b3f1c82d2a58005c1)
|
||||||
set(MINGW_HASH 5afe822af5c4edbf67daaf45eec61d538f49eef6b19524de64897c6b95828caf)
|
set(MINGW_HASH cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f)
|
||||||
set(OPENSSL_HASH 529043b15cffa5f36077a4d0af83f3de399807181d607441d734196d889b641f)
|
set(OPENSSL_HASH 344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0)
|
||||||
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
|
set(PKG_CONFIG_HASH 6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591)
|
||||||
set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
|
set(PUGIXML_HASH 655ade57fa703fb421c2eb9a0113b5064bddb145d415dd1f88c79353d90d511a)
|
||||||
set(ROCKSDB_HASH afccfab496556904900afacf7d99887f1d50cb893e5d2288bd502db233adacac)
|
set(ROCKSDB_HASH 3fdc9ca996971c4c039959866382c4a3a6c8ade4abf888f3b2ff77153e07bf28)
|
||||||
set(SPDLOG_HASH 15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
|
set(SPDLOG_HASH 7a80896357f3e8e920e85e92633b14ba0f229c506e6f978578bdc35ba09e9a5d)
|
||||||
set(SQLITE_HASH 9ad6d16cbc1df7cd55c8b55127c82a9bca5e9f287818de6dc87e04e73599d754)
|
set(SQLITE_HASH 6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3)
|
||||||
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
set(STDUUID_HASH b1176597e789531c38481acbbed2a6894ad419aab0979c10410d59eb0ebf40d3)
|
||||||
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
set(ZLIB_HASH 17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c)
|
||||||
|
@@ -2,9 +2,9 @@ if(PROJECT_ENABLE_WINFSP AND PROJECT_IS_MINGW)
|
|||||||
if(PROJECT_BUILD)
|
if(PROJECT_BUILD)
|
||||||
add_definitions(-DPROJECT_ENABLE_WINFSP)
|
add_definitions(-DPROJECT_ENABLE_WINFSP)
|
||||||
|
|
||||||
include_directories(BEFORE SYSTEM ${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/inc)
|
include_directories(BEFORE SYSTEM ${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/inc)
|
||||||
|
|
||||||
link_directories(BEFORE ${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/lib)
|
link_directories(BEFORE ${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/lib)
|
||||||
|
|
||||||
if(PROJECT_IS_ARM64)
|
if(PROJECT_IS_ARM64)
|
||||||
link_libraries(winfsp-a64)
|
link_libraries(winfsp-a64)
|
||||||
|
@@ -1,27 +1,27 @@
|
|||||||
set(BINUTILS_VERSION 2.44)
|
set(BINUTILS_VERSION 2.44)
|
||||||
set(BOOST2_MAJOR_VERSION 1)
|
|
||||||
set(BOOST2_MINOR_VERSION 76)
|
|
||||||
set(BOOST2_PATCH_VERSION 0)
|
|
||||||
set(BOOST_MAJOR_VERSION 1)
|
set(BOOST_MAJOR_VERSION 1)
|
||||||
set(BOOST_MINOR_VERSION 88)
|
set(BOOST_MINOR_VERSION 88)
|
||||||
set(BOOST_PATCH_VERSION 0)
|
set(BOOST_PATCH_VERSION 0)
|
||||||
set(CPP_HTTPLIB_VERSION 0.23.1)
|
set(BOOST2_MAJOR_VERSION 1)
|
||||||
set(CURL2_VERSION 8_15_0)
|
set(BOOST2_MINOR_VERSION 76)
|
||||||
set(CURL_VERSION 8.15.0)
|
set(BOOST2_PATCH_VERSION 0)
|
||||||
set(EXPAT2_VERSION 2_7_1)
|
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(EXPAT_VERSION 2.7.1)
|
||||||
set(GCC_VERSION 15.1.0)
|
set(EXPAT2_VERSION 2_7_1)
|
||||||
set(GTEST_VERSION 1.17.0)
|
set(GCC_VERSION 14.2.0)
|
||||||
|
set(GTEST_VERSION 1.16.0)
|
||||||
set(ICU_VERSION 76-1)
|
set(ICU_VERSION 76-1)
|
||||||
set(JSON_VERSION 3.12.0)
|
set(JSON_VERSION 3.12.0)
|
||||||
set(LIBSODIUM_VERSION 1.0.20)
|
set(LIBSODIUM_VERSION 1.0.20)
|
||||||
set(MINGW_VERSION 13.0.0)
|
set(MINGW_VERSION 12.0.0)
|
||||||
set(OPENSSL_VERSION 3.5.1)
|
set(OPENSSL_VERSION 3.5.0)
|
||||||
set(PKG_CONFIG_VERSION 0.29.2)
|
set(PKG_CONFIG_VERSION 0.29.2)
|
||||||
set(PUGIXML_VERSION 1.15)
|
set(PUGIXML_VERSION 1.15)
|
||||||
set(ROCKSDB_VERSION 10.4.2)
|
set(ROCKSDB_VERSION 10.0.1)
|
||||||
set(SPDLOG_VERSION 1.15.3)
|
set(SPDLOG_VERSION 1.15.2)
|
||||||
set(SQLITE2_VERSION 3.50.3)
|
set(SQLITE_VERSION 3490100)
|
||||||
set(SQLITE_VERSION 3500300)
|
set(SQLITE2_VERSION 3.49.1)
|
||||||
set(STDUUID_VERSION 1.2.3)
|
set(STDUUID_VERSION 1.2.3)
|
||||||
set(ZLIB_VERSION 1.3.1)
|
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_DESC="Mount utility for Sia and S3"
|
||||||
|
|
||||||
PROJECT_MAJOR_VERSION=2
|
PROJECT_MAJOR_VERSION=2
|
||||||
PROJECT_MINOR_VERSION=1
|
PROJECT_MINOR_VERSION=0
|
||||||
PROJECT_REVISION_VERSION=0
|
PROJECT_REVISION_VERSION=6
|
||||||
PROJECT_RELEASE_NUM=0
|
PROJECT_RELEASE_NUM=0
|
||||||
PROJECT_RELEASE_ITER=rc
|
PROJECT_RELEASE_ITER=rc
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#comment
|
#comment
|
||||||
FROM arm64v8/alpine:3.21.4
|
FROM arm64v8/alpine:3.21.3
|
||||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||||
CMD bash
|
CMD bash
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#comment
|
#comment
|
||||||
FROM alpine:3.21.4
|
FROM alpine:3.21.3
|
||||||
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
MAINTAINER Scott E. Graves <scott.e.graves@protonmail.com>
|
||||||
CMD bash
|
CMD bash
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#comment
|
#comment
|
||||||
FROM alpine:3.21.4
|
FROM alpine:3.21.3
|
||||||
|
|
||||||
RUN apk update
|
RUN apk update
|
||||||
RUN apk upgrade
|
RUN apk upgrade
|
||||||
|
@@ -23,7 +23,6 @@
|
|||||||
#define REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
|
#define REPERTORY_INCLUDE_COMM_CURL_CURL_COMM_HPP_
|
||||||
|
|
||||||
#include "app_config.hpp"
|
#include "app_config.hpp"
|
||||||
#include "comm/curl/curl_shared.hpp"
|
|
||||||
#include "comm/curl/multi_request.hpp"
|
#include "comm/curl/multi_request.hpp"
|
||||||
#include "comm/i_http_comm.hpp"
|
#include "comm/i_http_comm.hpp"
|
||||||
#include "events/event_system.hpp"
|
#include "events/event_system.hpp"
|
||||||
@@ -49,7 +48,6 @@ private:
|
|||||||
|
|
||||||
static const write_callback write_data;
|
static const write_callback write_data;
|
||||||
static const write_callback write_headers;
|
static const write_callback write_headers;
|
||||||
static constexpr std::uint8_t retry_request_count{5U};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::optional<host_config> host_config_;
|
std::optional<host_config> host_config_;
|
||||||
@@ -137,125 +135,101 @@ public:
|
|||||||
long &response_code, stop_type &stop_requested) -> bool {
|
long &response_code, stop_type &stop_requested) -> bool {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
CURLcode curl_code{};
|
if (request.decryption_token.has_value() &&
|
||||||
const auto do_request = [&]() -> bool {
|
not request.decryption_token.value().empty()) {
|
||||||
if (request.decryption_token.has_value() &&
|
return make_encrypted_request(cfg, request, response_code,
|
||||||
not request.decryption_token.value().empty()) {
|
stop_requested);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
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);
|
||||||
|
|
||||||
|
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, url);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.response_handler.has_value()) {
|
||||||
|
request.response_handler.value()(write_info.data, response_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -1,67 +0,0 @@
|
|||||||
/*
|
|
||||||
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,13 +26,11 @@
|
|||||||
|
|
||||||
namespace repertory::curl::requests {
|
namespace repertory::curl::requests {
|
||||||
struct http_delete final : http_request_base {
|
struct http_delete final : http_request_base {
|
||||||
[[nodiscard]] auto get_type() const -> std::string override {
|
~http_delete() override = default;
|
||||||
return "delete";
|
|
||||||
}
|
|
||||||
|
|
||||||
[[nodiscard]] auto set_method(CURL *curl,
|
[[nodiscard]] auto
|
||||||
stop_type & /* stop_requested */) const
|
set_method(CURL *curl,
|
||||||
-> bool override {
|
stop_type & /* stop_requested */) const -> bool override {
|
||||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
|
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -33,11 +33,9 @@ struct http_get final : http_request_base {
|
|||||||
auto operator=(http_get &&) -> http_get & = default;
|
auto operator=(http_get &&) -> http_get & = default;
|
||||||
~http_get() override = default;
|
~http_get() override = default;
|
||||||
|
|
||||||
[[nodiscard]] auto get_type() const -> std::string override { return "get"; }
|
[[nodiscard]] auto
|
||||||
|
set_method(CURL *curl,
|
||||||
[[nodiscard]] auto set_method(CURL *curl,
|
stop_type & /*stop_requested*/) const -> bool override {
|
||||||
stop_type & /*stop_requested*/) const
|
|
||||||
-> bool override {
|
|
||||||
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
|
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
namespace repertory::curl::requests {
|
namespace repertory::curl::requests {
|
||||||
struct http_head final : http_request_base {
|
struct http_head final : http_request_base {
|
||||||
[[nodiscard]] auto get_type() const -> std::string override { return "head"; }
|
~http_head() override = default;
|
||||||
|
|
||||||
[[nodiscard]] auto set_method(CURL *curl,
|
[[nodiscard]] auto
|
||||||
stop_type & /* stop_requested */) const
|
set_method(CURL *curl,
|
||||||
-> bool override {
|
stop_type & /* stop_requested */) const -> bool override {
|
||||||
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "HEAD");
|
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "HEAD");
|
||||||
curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
|
curl_easy_setopt(curl, CURLOPT_NOBODY, 1L);
|
||||||
return true;
|
return true;
|
||||||
|
@@ -26,9 +26,15 @@
|
|||||||
|
|
||||||
namespace repertory::curl::requests {
|
namespace repertory::curl::requests {
|
||||||
struct http_post final : http_request_base {
|
struct http_post final : http_request_base {
|
||||||
std::optional<nlohmann::json> json;
|
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;
|
||||||
|
|
||||||
[[nodiscard]] auto get_type() const -> std::string override { return "post"; }
|
~http_post() override = default;
|
||||||
|
|
||||||
|
std::optional<nlohmann::json> json;
|
||||||
|
|
||||||
[[nodiscard]] auto set_method(CURL *curl,
|
[[nodiscard]] auto set_method(CURL *curl,
|
||||||
stop_type & /*stop_requested*/) const
|
stop_type & /*stop_requested*/) const
|
||||||
|
@@ -27,11 +27,18 @@
|
|||||||
|
|
||||||
namespace repertory::curl::requests {
|
namespace repertory::curl::requests {
|
||||||
struct http_put_file final : http_request_base {
|
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::shared_ptr<utils::encryption::encrypting_reader> reader;
|
||||||
std::string source_path;
|
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
|
[[nodiscard]] auto set_method(CURL *curl, stop_type &stop_requested) const
|
||||||
-> bool override;
|
-> bool override;
|
||||||
|
|
||||||
|
@@ -61,8 +61,6 @@ struct http_request_base {
|
|||||||
|
|
||||||
[[nodiscard]] virtual auto get_path() const -> std::string { return path; }
|
[[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,
|
[[nodiscard]] virtual auto set_method(CURL *curl,
|
||||||
stop_type &stop_requested) const
|
stop_type &stop_requested) const
|
||||||
-> bool = 0;
|
-> bool = 0;
|
||||||
|
@@ -64,14 +64,17 @@ protected:
|
|||||||
[[nodiscard]] auto get_effective_uid() const -> uid_t;
|
[[nodiscard]] auto get_effective_uid() const -> uid_t;
|
||||||
|
|
||||||
[[nodiscard]] static auto check_open_flags(int flags, int mask,
|
[[nodiscard]] static auto check_open_flags(int flags, int mask,
|
||||||
api_error fail_error) -> api_error;
|
const api_error &fail_error)
|
||||||
|
-> api_error;
|
||||||
|
|
||||||
[[nodiscard]] auto check_owner(const api_meta_map &meta) const -> api_error;
|
[[nodiscard]] auto check_owner(const api_meta_map &meta) const -> api_error;
|
||||||
|
|
||||||
[[nodiscard]] static auto check_readable(int flags, api_error fail_error)
|
[[nodiscard]] static auto check_readable(int flags,
|
||||||
|
const api_error &fail_error)
|
||||||
-> api_error;
|
-> api_error;
|
||||||
|
|
||||||
[[nodiscard]] static auto check_writeable(int flags, api_error fail_error)
|
[[nodiscard]] static auto check_writeable(int flags,
|
||||||
|
const api_error &fail_error)
|
||||||
-> api_error;
|
-> api_error;
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
|
@@ -28,11 +28,9 @@
|
|||||||
namespace repertory {
|
namespace repertory {
|
||||||
struct curl_error final : public i_event {
|
struct curl_error final : public i_event {
|
||||||
curl_error() = default;
|
curl_error() = default;
|
||||||
curl_error(CURLcode code_, std::string_view function_name_, std::string type_,
|
curl_error(CURLcode code_, std::string_view function_name_, std::string url_)
|
||||||
std::string url_)
|
|
||||||
: code(code_),
|
: code(code_),
|
||||||
function_name(std::string{function_name_}),
|
function_name(std::string{function_name_}),
|
||||||
type(std::move(type_)),
|
|
||||||
url(std::move(url_)) {}
|
url(std::move(url_)) {}
|
||||||
|
|
||||||
static constexpr event_level level{event_level::error};
|
static constexpr event_level level{event_level::error};
|
||||||
@@ -40,7 +38,6 @@ struct curl_error final : public i_event {
|
|||||||
|
|
||||||
CURLcode code{};
|
CURLcode code{};
|
||||||
std::string function_name;
|
std::string function_name;
|
||||||
std::string type;
|
|
||||||
std::string url;
|
std::string url;
|
||||||
|
|
||||||
[[nodiscard]] auto get_event_level() const -> event_level override {
|
[[nodiscard]] auto get_event_level() const -> event_level override {
|
||||||
@@ -52,8 +49,8 @@ struct curl_error final : public i_event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] auto get_single_line() const -> std::string override {
|
[[nodiscard]] auto get_single_line() const -> std::string override {
|
||||||
return fmt::format("{}|func|{}|type|{}|url|{}|code|{}", name, function_name,
|
return fmt::format("{}|func|{}|url|{}|code|{}", name, function_name, url,
|
||||||
type, url, static_cast<int>(code));
|
static_cast<int>(code));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
@@ -63,14 +60,12 @@ template <> struct adl_serializer<repertory::curl_error> {
|
|||||||
static void to_json(json &data, const repertory::curl_error &value) {
|
static void to_json(json &data, const repertory::curl_error &value) {
|
||||||
data["code"] = value.code;
|
data["code"] = value.code;
|
||||||
data["function_name"] = value.function_name;
|
data["function_name"] = value.function_name;
|
||||||
data["type"] = value.type;
|
|
||||||
data["url"] = value.url;
|
data["url"] = value.url;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void from_json(const json &data, repertory::curl_error &value) {
|
static void from_json(const json &data, repertory::curl_error &value) {
|
||||||
data.at("code").get_to<CURLcode>(value.code);
|
data.at("code").get_to<CURLcode>(value.code);
|
||||||
data.at("function_name").get_to<std::string>(value.function_name);
|
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);
|
data.at("url").get_to<std::string>(value.url);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -66,7 +66,7 @@ public:
|
|||||||
std::condition_variable notify_;
|
std::condition_variable notify_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void notify(api_error err);
|
void notify(const api_error &err);
|
||||||
|
|
||||||
auto wait() -> api_error;
|
auto wait() -> api_error;
|
||||||
};
|
};
|
||||||
@@ -149,7 +149,7 @@ protected:
|
|||||||
|
|
||||||
void reset_timeout();
|
void reset_timeout();
|
||||||
|
|
||||||
auto set_api_error(api_error err) -> api_error;
|
auto set_api_error(const api_error &err) -> api_error;
|
||||||
|
|
||||||
void set_file_size(std::uint64_t size);
|
void set_file_size(std::uint64_t size);
|
||||||
|
|
||||||
|
@@ -70,9 +70,8 @@ private:
|
|||||||
-> api_error;
|
-> api_error;
|
||||||
|
|
||||||
[[nodiscard]] auto get_last_modified(bool directory,
|
[[nodiscard]] auto get_last_modified(bool directory,
|
||||||
const std::string &api_path,
|
const std::string &api_path) const
|
||||||
std::uint64_t &last_modified) const
|
-> std::uint64_t;
|
||||||
-> api_error;
|
|
||||||
|
|
||||||
[[nodiscard]] auto
|
[[nodiscard]] auto
|
||||||
get_object_info(bool directory, const std::string &api_path,
|
get_object_info(bool directory, const std::string &api_path,
|
||||||
|
@@ -221,7 +221,8 @@ 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 api_error_to_string(api_error error) -> const std::string &;
|
[[nodiscard]] auto api_error_to_string(const api_error &error)
|
||||||
|
-> const std::string &;
|
||||||
|
|
||||||
enum class database_type {
|
enum class database_type {
|
||||||
rocksdb,
|
rocksdb,
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
namespace repertory::utils::error {
|
namespace repertory::utils::error {
|
||||||
void raise_error(std::string_view function, std::string_view msg);
|
void raise_error(std::string_view function, std::string_view msg);
|
||||||
|
|
||||||
void raise_error(std::string_view function, api_error err,
|
void raise_error(std::string_view function, const api_error &err,
|
||||||
std::string_view msg);
|
std::string_view msg);
|
||||||
|
|
||||||
void raise_error(std::string_view function, const std::exception &exception);
|
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,
|
void raise_error(std::string_view function, const json &err,
|
||||||
std::string_view msg);
|
std::string_view msg);
|
||||||
|
|
||||||
void raise_error(std::string_view function, api_error err,
|
void raise_error(std::string_view function, const api_error &err,
|
||||||
std::string_view file_path, std::string_view msg);
|
std::string_view file_path, std::string_view msg);
|
||||||
|
|
||||||
void raise_error(std::string_view function, std::int64_t err,
|
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);
|
std::string_view file_path, std::string_view msg);
|
||||||
|
|
||||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||||
api_error err, std::string_view msg);
|
const api_error &err, std::string_view msg);
|
||||||
|
|
||||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||||
const std::exception &exception);
|
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);
|
const json &err, std::string_view msg);
|
||||||
|
|
||||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||||
std::string_view source_path, api_error err,
|
std::string_view source_path, const api_error &err,
|
||||||
std::string_view msg);
|
std::string_view msg);
|
||||||
|
|
||||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||||
|
@@ -37,7 +37,7 @@ inline const std::array<std::string, 4U> attribute_namespaces = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[[nodiscard]] auto from_api_error(api_error err) -> int;
|
[[nodiscard]] auto from_api_error(const api_error &err) -> int;
|
||||||
|
|
||||||
[[nodiscard]] auto to_api_error(int err) -> api_error;
|
[[nodiscard]] auto to_api_error(int err) -> api_error;
|
||||||
|
|
||||||
|
@@ -28,19 +28,19 @@
|
|||||||
#include "utils/windows.hpp"
|
#include "utils/windows.hpp"
|
||||||
|
|
||||||
namespace repertory::utils {
|
namespace repertory::utils {
|
||||||
[[nodiscard]] auto get_accessed_time_from_meta(const api_meta_map &meta)
|
[[nodiscard]] auto
|
||||||
-> std::uint64_t;
|
get_accessed_time_from_meta(const api_meta_map &meta) -> std::uint64_t;
|
||||||
|
|
||||||
[[nodiscard]] auto get_changed_time_from_meta(const api_meta_map &meta)
|
[[nodiscard]] auto
|
||||||
-> std::uint64_t;
|
get_changed_time_from_meta(const api_meta_map &meta) -> std::uint64_t;
|
||||||
|
|
||||||
[[nodiscard]] auto get_creation_time_from_meta(const api_meta_map &meta)
|
[[nodiscard]] auto
|
||||||
-> std::uint64_t;
|
get_creation_time_from_meta(const api_meta_map &meta) -> std::uint64_t;
|
||||||
|
|
||||||
[[nodiscard]] auto get_written_time_from_meta(const api_meta_map &meta)
|
[[nodiscard]] auto
|
||||||
-> std::uint64_t;
|
get_written_time_from_meta(const api_meta_map &meta) -> std::uint64_t;
|
||||||
|
|
||||||
[[nodiscard]] auto from_api_error(api_error e) -> NTSTATUS;
|
[[nodiscard]] auto from_api_error(const api_error &e) -> NTSTATUS;
|
||||||
|
|
||||||
[[nodiscard]] auto unix_access_mask_to_windows(std::int32_t mask) -> int;
|
[[nodiscard]] auto unix_access_mask_to_windows(std::int32_t mask) -> int;
|
||||||
|
|
||||||
|
@@ -41,8 +41,8 @@ const curl_comm::write_callback curl_comm::write_headers =
|
|||||||
size_t nitems,
|
size_t nitems,
|
||||||
void *outstream) -> size_t {
|
void *outstream) -> size_t {
|
||||||
auto &headers = *reinterpret_cast<http_headers *>(outstream);
|
auto &headers = *reinterpret_cast<http_headers *>(outstream);
|
||||||
auto header = std::string(buffer, size * nitems);
|
const auto header = std::string(buffer, size * nitems);
|
||||||
auto parts = utils::string::split(header, ':', false);
|
const auto parts = utils::string::split(header, ':', false);
|
||||||
if (parts.size() > 1U) {
|
if (parts.size() > 1U) {
|
||||||
auto data = header.substr(parts[0U].size() + 1U);
|
auto data = header.substr(parts[0U].size() + 1U);
|
||||||
utils::string::left_trim(data);
|
utils::string::left_trim(data);
|
||||||
|
@@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
#include "comm/curl/curl_shared.hpp"
|
|
||||||
#include "utils/error.hpp"
|
|
||||||
|
|
||||||
namespace repertory {
|
|
||||||
curl_shared::curl_sh_t curl_shared::cache_;
|
|
||||||
|
|
||||||
std::recursive_mutex curl_shared::mtx_;
|
|
||||||
|
|
||||||
void curl_shared::cleanup() {
|
|
||||||
cache_.reset(nullptr);
|
|
||||||
curl_global_cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
auto curl_shared::init() -> bool {
|
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
|
||||||
|
|
||||||
auto res = curl_global_init(CURL_GLOBAL_ALL);
|
|
||||||
if (res != 0) {
|
|
||||||
utils::error::handle_error(function_name,
|
|
||||||
"failed to initialize curl|result|" +
|
|
||||||
std::to_string(res));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto *cache = curl_share_init();
|
|
||||||
if (cache == nullptr) {
|
|
||||||
utils::error::handle_error(function_name, "failed to create curl share");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
cache_.reset(cache);
|
|
||||||
|
|
||||||
curl_share_setopt(cache, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
|
|
||||||
curl_share_setopt(cache, CURLSHOPT_LOCKFUNC, lock_callback);
|
|
||||||
curl_share_setopt(cache, CURLSHOPT_UNLOCKFUNC, unlock_callback);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void curl_shared::lock_callback(CURL * /* curl */, curl_lock_data data,
|
|
||||||
curl_lock_access /* access */,
|
|
||||||
void * /* ptr */) {
|
|
||||||
if (data != CURL_LOCK_DATA_DNS) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mtx_.lock();
|
|
||||||
}
|
|
||||||
|
|
||||||
void curl_shared::set_share(CURL *curl) {
|
|
||||||
curl_easy_setopt(curl, CURLOPT_SHARE, cache_.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
void curl_shared::unlock_callback(CURL * /* curl */, curl_lock_data data,
|
|
||||||
curl_lock_access /* access */,
|
|
||||||
void * /* ptr */) {
|
|
||||||
if (data != CURL_LOCK_DATA_DNS) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
mtx_.unlock();
|
|
||||||
}
|
|
||||||
} // namespace repertory
|
|
@@ -44,22 +44,21 @@ void multi_request::get_result(CURLcode &curl_code, long &http_code) {
|
|||||||
curl_code = CURLcode::CURLE_ABORTED_BY_CALLBACK;
|
curl_code = CURLcode::CURLE_ABORTED_BY_CALLBACK;
|
||||||
http_code = -1;
|
http_code = -1;
|
||||||
|
|
||||||
auto error{false};
|
auto error = false;
|
||||||
int running_handles{0};
|
int running_handles = 0;
|
||||||
curl_multi_perform(multi_handle_, &running_handles);
|
curl_multi_perform(multi_handle_, &running_handles);
|
||||||
while (not error && (running_handles > 0) && not get_stop_requested()) {
|
while (not error && (running_handles > 0) && not get_stop_requested()) {
|
||||||
int ignored{};
|
int ignored{};
|
||||||
curl_multi_wait(multi_handle_, nullptr, 0, timeout_ms, &ignored);
|
curl_multi_wait(multi_handle_, nullptr, 0, timeout_ms, &ignored);
|
||||||
|
|
||||||
auto ret = curl_multi_perform(multi_handle_, &running_handles);
|
const auto ret = curl_multi_perform(multi_handle_, &running_handles);
|
||||||
error = (ret != CURLM_CALL_MULTI_PERFORM) && (ret != CURLM_OK);
|
error = (ret != CURLM_CALL_MULTI_PERFORM) && (ret != CURLM_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not get_stop_requested()) {
|
if (not get_stop_requested()) {
|
||||||
int remaining_messages{0};
|
int remaining_messages = 0;
|
||||||
auto *multi_result{
|
auto *multi_result =
|
||||||
curl_multi_info_read(multi_handle_, &remaining_messages),
|
curl_multi_info_read(multi_handle_, &remaining_messages);
|
||||||
};
|
|
||||||
if ((multi_result != nullptr) && (multi_result->msg == CURLMSG_DONE)) {
|
if ((multi_result != nullptr) && (multi_result->msg == CURLMSG_DONE)) {
|
||||||
curl_easy_getinfo(multi_result->easy_handle, CURLINFO_RESPONSE_CODE,
|
curl_easy_getinfo(multi_result->easy_handle, CURLINFO_RESPONSE_CODE,
|
||||||
&http_code);
|
&http_code);
|
||||||
|
@@ -381,7 +381,6 @@ auto fuse_base::init_impl(struct fuse_conn_info *conn) -> void * {
|
|||||||
if (not console_enabled_ && not repertory::project_initialize()) {
|
if (not console_enabled_ && not repertory::project_initialize()) {
|
||||||
utils::error::raise_error(function_name, "failed to initialize repertory");
|
utils::error::raise_error(function_name, "failed to initialize repertory");
|
||||||
event_system::instance().raise<unmount_requested>(function_name);
|
event_system::instance().raise<unmount_requested>(function_name);
|
||||||
repertory::project_cleanup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@@ -138,7 +138,8 @@ auto fuse_drive_base::check_and_perform(
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive_base::check_open_flags(int flags, int mask,
|
auto fuse_drive_base::check_open_flags(int flags, int mask,
|
||||||
api_error fail_error) -> api_error {
|
const api_error &fail_error)
|
||||||
|
-> api_error {
|
||||||
return (((flags & mask) == 0) ? api_error::success : fail_error);
|
return (((flags & mask) == 0) ? api_error::success : fail_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,13 +196,13 @@ auto fuse_drive_base::check_parent_access(const std::string &api_path,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive_base::check_readable(int flags, api_error fail_error)
|
auto fuse_drive_base::check_readable(int flags, const api_error &fail_error)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
auto mode = (flags & O_ACCMODE);
|
auto mode = (flags & O_ACCMODE);
|
||||||
return ((mode == O_WRONLY) ? fail_error : api_error::success);
|
return ((mode == O_WRONLY) ? fail_error : api_error::success);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto fuse_drive_base::check_writeable(int flags, api_error fail_error)
|
auto fuse_drive_base::check_writeable(int flags, const api_error &fail_error)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
return (((flags & O_ACCMODE) == 0) ? fail_error : api_error::success);
|
return (((flags & O_ACCMODE) == 0) ? fail_error : api_error::success);
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,6 @@
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <memory>
|
|
||||||
#if !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
|
|
||||||
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
#include "drives/fuse/remotefuse/remote_fuse_drive.hpp"
|
||||||
@@ -103,7 +102,7 @@ void remote_fuse_drive::destroy_impl(void *ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (remote_instance_) {
|
if (remote_instance_) {
|
||||||
auto res = remote_instance_->fuse_destroy();
|
const auto res = remote_instance_->fuse_destroy();
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
utils::error::raise_error(function_name,
|
utils::error::raise_error(function_name,
|
||||||
"remote fuse_destroy() failed|err|" +
|
"remote fuse_destroy() failed|err|" +
|
||||||
@@ -129,8 +128,8 @@ auto remote_fuse_drive::fgetattr_impl(std::string api_path,
|
|||||||
remote::stat r_stat{};
|
remote::stat r_stat{};
|
||||||
auto directory = false;
|
auto directory = false;
|
||||||
|
|
||||||
auto res = remote_instance_->fuse_fgetattr(api_path.c_str(), r_stat,
|
const auto res = remote_instance_->fuse_fgetattr(api_path.c_str(), r_stat,
|
||||||
directory, f_info->fh);
|
directory, f_info->fh);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
populate_stat(r_stat, directory, *unix_st);
|
populate_stat(r_stat, directory, *unix_st);
|
||||||
}
|
}
|
||||||
@@ -192,7 +191,7 @@ auto remote_fuse_drive::getattr_impl(std::string api_path, struct stat *unix_st)
|
|||||||
bool directory = false;
|
bool directory = false;
|
||||||
remote::stat r_stat{};
|
remote::stat r_stat{};
|
||||||
|
|
||||||
auto res =
|
const auto res =
|
||||||
remote_instance_->fuse_getattr(api_path.c_str(), r_stat, directory);
|
remote_instance_->fuse_getattr(api_path.c_str(), r_stat, directory);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
populate_stat(r_stat, directory, *unix_st);
|
populate_stat(r_stat, directory, *unix_st);
|
||||||
@@ -209,9 +208,9 @@ api_error remote_fuse_drive::getxtimes_impl(std::string api_path,
|
|||||||
return utils::to_api_error(-EFAULT);
|
return utils::to_api_error(-EFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
remote::file_time repertory_bkuptime{0U};
|
remote::file_time repertory_bkuptime = 0u;
|
||||||
remote::file_time repertory_crtime{0U};
|
remote::file_time repertory_crtime = 0u;
|
||||||
auto res = remote_instance_->fuse_getxtimes(
|
const auto res = remote_instance_->fuse_getxtimes(
|
||||||
api_path.c_str(), repertory_bkuptime, repertory_crtime);
|
api_path.c_str(), repertory_bkuptime, repertory_crtime);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
bkuptime->tv_nsec =
|
bkuptime->tv_nsec =
|
||||||
@@ -382,7 +381,7 @@ auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
|||||||
fuse_fill_dir_t fuse_fill_dir,
|
fuse_fill_dir_t fuse_fill_dir,
|
||||||
off_t offset,
|
off_t offset,
|
||||||
struct fuse_file_info *f_info,
|
struct fuse_file_info *f_info,
|
||||||
fuse_readdir_flags /* flags */)
|
fuse_readdir_flags /*flags*/)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
#else // FUSE_USE_VERSION < 30
|
#else // FUSE_USE_VERSION < 30
|
||||||
auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
||||||
@@ -391,42 +390,20 @@ auto remote_fuse_drive::readdir_impl(std::string api_path, void *buf,
|
|||||||
struct fuse_file_info *f_info)
|
struct fuse_file_info *f_info)
|
||||||
-> api_error {
|
-> api_error {
|
||||||
#endif // FUSE_USE_VERSION >= 30
|
#endif // FUSE_USE_VERSION >= 30
|
||||||
|
|
||||||
std::string item_path;
|
std::string item_path;
|
||||||
int res{0};
|
int res = 0;
|
||||||
while ((res = remote_instance_->fuse_readdir(
|
while ((res = remote_instance_->fuse_readdir(
|
||||||
api_path.c_str(), static_cast<remote::file_offset>(offset),
|
api_path.c_str(), static_cast<remote::file_offset>(offset),
|
||||||
f_info->fh, item_path)) == 0) {
|
f_info->fh, item_path)) == 0) {
|
||||||
std::unique_ptr<struct stat> p_stat{nullptr};
|
if ((item_path != ".") && (item_path != "..")) {
|
||||||
int stat_res{0};
|
|
||||||
if ((item_path == ".") || (item_path == "..")) {
|
|
||||||
p_stat = std::make_unique<struct stat>();
|
|
||||||
std::memset(p_stat.get(), 0, sizeof(struct stat));
|
|
||||||
if (item_path == ".") {
|
|
||||||
stat_res =
|
|
||||||
stat(utils::path::combine(get_mount_location(), {api_path}).c_str(),
|
|
||||||
p_stat.get());
|
|
||||||
} else {
|
|
||||||
stat_res =
|
|
||||||
stat(utils::path::get_parent_path(
|
|
||||||
utils::path::combine(get_mount_location(), {api_path}))
|
|
||||||
.c_str(),
|
|
||||||
p_stat.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stat_res != 0) {
|
|
||||||
res = stat_res;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
item_path = utils::path::strip_to_file_name(item_path);
|
item_path = utils::path::strip_to_file_name(item_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if FUSE_USE_VERSION >= 30
|
#if FUSE_USE_VERSION >= 30
|
||||||
if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset,
|
if (fuse_fill_dir(buf, item_path.c_str(), nullptr, ++offset,
|
||||||
FUSE_FILL_DIR_PLUS) != 0) {
|
static_cast<fuse_fill_dir_flags>(0)) != 0) {
|
||||||
#else // FUSE_USE_VERSION < 30
|
#else // FUSE_USE_VERSION < 30
|
||||||
if (fuse_fill_dir(buf, item_path.c_str(), p_stat.get(), ++offset) != 0) {
|
if (fuse_fill_dir(buf, item_path.c_str(), nullptr, ++offset) != 0) {
|
||||||
#endif // FUSE_USE_VERSION >= 30
|
#endif // FUSE_USE_VERSION >= 30
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -615,7 +592,7 @@ auto remote_fuse_drive::write_impl(std::string api_path, const char *buffer,
|
|||||||
size_t write_size, off_t write_offset,
|
size_t write_size, off_t write_offset,
|
||||||
struct fuse_file_info *f_info,
|
struct fuse_file_info *f_info,
|
||||||
std::size_t &bytes_written) -> api_error {
|
std::size_t &bytes_written) -> api_error {
|
||||||
auto res = remote_instance_->fuse_write(
|
const auto res = remote_instance_->fuse_write(
|
||||||
api_path.c_str(), buffer, write_size,
|
api_path.c_str(), buffer, write_size,
|
||||||
static_cast<remote::file_offset>(write_offset), f_info->fh);
|
static_cast<remote::file_offset>(write_offset), f_info->fh);
|
||||||
if (res >= 0) {
|
if (res >= 0) {
|
||||||
|
@@ -370,7 +370,7 @@ auto file_manager::is_processing(const std::string &api_path) const -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
unique_mutex_lock upload_lock(upload_mtx_);
|
unique_mutex_lock upload_lock(upload_mtx_);
|
||||||
if (upload_lookup_.contains(api_path)) {
|
if (upload_lookup_.find(api_path) != upload_lookup_.end()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
upload_lock.unlock();
|
upload_lock.unlock();
|
||||||
@@ -695,7 +695,7 @@ void file_manager::remove_upload(const std::string &api_path, bool no_lock) {
|
|||||||
"failed to remove active upload");
|
"failed to remove active upload");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (upload_lookup_.contains(api_path)) {
|
if (upload_lookup_.find(api_path) != upload_lookup_.end()) {
|
||||||
upload_lookup_.at(api_path)->cancel();
|
upload_lookup_.at(api_path)->cancel();
|
||||||
upload_lookup_.erase(api_path);
|
upload_lookup_.erase(api_path);
|
||||||
}
|
}
|
||||||
@@ -871,12 +871,9 @@ void file_manager::start() {
|
|||||||
stop_requested_ = false;
|
stop_requested_ = false;
|
||||||
|
|
||||||
polling::instance().set_callback({
|
polling::instance().set_callback({
|
||||||
.name = "timed_out_close",
|
"timed_out_close",
|
||||||
.freq = polling::frequency::second,
|
polling::frequency::second,
|
||||||
.action =
|
[this](auto && /* stop_requested */) { this->close_timed_out_files(); },
|
||||||
[this](auto && /* stop_requested */) {
|
|
||||||
this->close_timed_out_files();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (provider_.is_read_only()) {
|
if (provider_.is_read_only()) {
|
||||||
@@ -1005,10 +1002,10 @@ void file_manager::store_resume(const i_open_file &file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mgr_db_->add_resume(i_file_mgr_db::resume_entry{
|
if (mgr_db_->add_resume(i_file_mgr_db::resume_entry{
|
||||||
.api_path = file.get_api_path(),
|
file.get_api_path(),
|
||||||
.chunk_size = file.get_chunk_size(),
|
file.get_chunk_size(),
|
||||||
.read_state = file.get_read_state(),
|
file.get_read_state(),
|
||||||
.source_path = file.get_source_path(),
|
file.get_source_path(),
|
||||||
})) {
|
})) {
|
||||||
event_system::instance().raise<download_resume_added>(
|
event_system::instance().raise<download_resume_added>(
|
||||||
file.get_api_path(), file.get_source_path(), function_name);
|
file.get_api_path(), file.get_source_path(), function_name);
|
||||||
@@ -1113,8 +1110,8 @@ void file_manager::upload_handler() {
|
|||||||
if (mgr_db_->remove_upload(entry->api_path)) {
|
if (mgr_db_->remove_upload(entry->api_path)) {
|
||||||
if (not mgr_db_->add_upload_active(
|
if (not mgr_db_->add_upload_active(
|
||||||
i_file_mgr_db::upload_active_entry{
|
i_file_mgr_db::upload_active_entry{
|
||||||
.api_path = entry->api_path,
|
entry->api_path,
|
||||||
.source_path = entry->source_path,
|
entry->source_path,
|
||||||
})) {
|
})) {
|
||||||
utils::error::raise_api_path_error(
|
utils::error::raise_api_path_error(
|
||||||
function_name, entry->api_path, entry->source_path,
|
function_name, entry->api_path, entry->source_path,
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
#include "utils/path.hpp"
|
#include "utils/path.hpp"
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
void open_file_base::download::notify(api_error err) {
|
void open_file_base::download::notify(const api_error &err) {
|
||||||
complete_ = true;
|
complete_ = true;
|
||||||
error_ = err;
|
error_ = err;
|
||||||
unique_mutex_lock lock(mtx_);
|
unique_mutex_lock lock(mtx_);
|
||||||
@@ -360,7 +360,7 @@ void open_file_base::reset_timeout() {
|
|||||||
last_access_ = std::chrono::system_clock::now();
|
last_access_ = std::chrono::system_clock::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto open_file_base::set_api_error(api_error err) -> api_error {
|
auto open_file_base::set_api_error(const api_error &err) -> api_error {
|
||||||
mutex_lock error_lock(error_mtx_);
|
mutex_lock error_lock(error_mtx_);
|
||||||
if (error_ == err) {
|
if (error_ == err) {
|
||||||
return error_;
|
return error_;
|
||||||
|
@@ -19,6 +19,10 @@
|
|||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
#if defined(PROJECT_ENABLE_CURL)
|
||||||
|
#include <curl/curl.h>
|
||||||
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_OPENSSL)
|
#if defined(PROJECT_ENABLE_OPENSSL)
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
#endif // defined(PROJECT_ENABLE_OPENSSL)
|
#endif // defined(PROJECT_ENABLE_OPENSSL)
|
||||||
@@ -39,34 +43,13 @@
|
|||||||
#include "spdlog/spdlog.h"
|
#include "spdlog/spdlog.h"
|
||||||
|
|
||||||
#include "initialize.hpp"
|
#include "initialize.hpp"
|
||||||
#include "utils/error.hpp"
|
|
||||||
|
|
||||||
#if defined(PROJECT_REQUIRE_ALPINE) && !defined(PROJECT_IS_MINGW)
|
#if defined(PROJECT_REQUIRE_ALPINE) && !defined(PROJECT_IS_MINGW)
|
||||||
#include "utils/path.hpp"
|
#include "utils/path.hpp"
|
||||||
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_CURL)
|
|
||||||
#include "comm/curl/curl_shared.hpp"
|
|
||||||
#endif // defined(PROJECT_ENABLE_CURL)
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
#if defined(PROJECT_ENABLE_CURL)
|
|
||||||
bool curl_initialized{false};
|
|
||||||
#endif // defined(PROJECT_ENABLE_CURL)
|
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_SPDLOG)
|
|
||||||
bool spdlog_initialized{false};
|
|
||||||
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_SQLITE)
|
|
||||||
bool sqlite3_initialized{false};
|
|
||||||
#endif // defined(PROJECT_ENABLE_SQLITE)
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
auto project_initialize() -> bool {
|
auto project_initialize() -> bool {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
|
||||||
|
|
||||||
#if defined(PROJECT_REQUIRE_ALPINE) && !defined(PROJECT_IS_MINGW)
|
#if defined(PROJECT_REQUIRE_ALPINE) && !defined(PROJECT_IS_MINGW)
|
||||||
{
|
{
|
||||||
static constexpr auto guard_size{4096U};
|
static constexpr auto guard_size{4096U};
|
||||||
@@ -81,43 +64,42 @@ auto project_initialize() -> bool {
|
|||||||
}
|
}
|
||||||
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
#endif // defined(PROJECT_REQUIRE_ALPINE) && !defined (PROJECT_IS_MINGW)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_SPDLOG)
|
|
||||||
spdlog::drop_all();
|
spdlog::drop_all();
|
||||||
spdlog::flush_every(std::chrono::seconds(5));
|
spdlog::flush_every(std::chrono::seconds(10));
|
||||||
spdlog::set_pattern("%Y-%m-%d|%T.%e|%^%l%$|%v");
|
spdlog::set_pattern("%Y-%m-%d|%T.%e|%^%l%$|%v");
|
||||||
spdlog_initialized = true;
|
|
||||||
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
#if defined(PROJECT_ENABLE_LIBSODIUM)
|
||||||
if (sodium_init() == -1) {
|
{
|
||||||
utils::error::handle_error(function_name, "failed to initialize sodium");
|
if (sodium_init() == -1) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif // defined(PROJECT_ENABLE_LIBSODIUM)
|
#endif // defined(PROJECT_ENABLE_LIBSODIUM)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_OPENSSL)
|
#if defined(PROJECT_ENABLE_OPENSSL)
|
||||||
SSL_library_init();
|
{
|
||||||
|
SSL_library_init();
|
||||||
|
}
|
||||||
#endif // defined(PROJECT_ENABLE_OPENSSL)
|
#endif // defined(PROJECT_ENABLE_OPENSSL)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_CURL)
|
#if defined(PROJECT_ENABLE_CURL)
|
||||||
if (not curl_shared::init()) {
|
{
|
||||||
return false;
|
auto res = curl_global_init(CURL_GLOBAL_ALL);
|
||||||
|
if (res != 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_initialized = true;
|
|
||||||
#endif // defined(PROJECT_ENABLE_CURL)
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_SQLITE)
|
#if defined(PROJECT_ENABLE_SQLITE)
|
||||||
{
|
{
|
||||||
auto res = sqlite3_initialize();
|
auto res = sqlite3_initialize();
|
||||||
if (res != SQLITE_OK) {
|
if (res != SQLITE_OK) {
|
||||||
utils::error::handle_error(function_name,
|
#if defined(PROJECT_ENABLE_CURL)
|
||||||
"failed to initialize sqlite3|result|" +
|
curl_global_cleanup();
|
||||||
std::to_string(res));
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlite3_initialized = true;
|
|
||||||
}
|
}
|
||||||
#endif // defined(PROJECT_ENABLE_SQLITE)
|
#endif // defined(PROJECT_ENABLE_SQLITE)
|
||||||
|
|
||||||
@@ -126,24 +108,12 @@ auto project_initialize() -> bool {
|
|||||||
|
|
||||||
void project_cleanup() {
|
void project_cleanup() {
|
||||||
#if defined(PROJECT_ENABLE_CURL)
|
#if defined(PROJECT_ENABLE_CURL)
|
||||||
if (curl_initialized) {
|
curl_global_cleanup();
|
||||||
curl_shared::cleanup();
|
|
||||||
curl_initialized = false;
|
|
||||||
}
|
|
||||||
#endif // defined(PROJECT_ENABLE_CURL)
|
#endif // defined(PROJECT_ENABLE_CURL)
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_SQLITE)
|
#if defined(PROJECT_ENABLE_SQLITE)
|
||||||
if (sqlite3_initialized) {
|
sqlite3_shutdown();
|
||||||
sqlite3_shutdown();
|
|
||||||
sqlite3_initialized = false;
|
|
||||||
}
|
|
||||||
#endif // defined(PROJECT_ENABLE_SQLITE)
|
#endif // defined(PROJECT_ENABLE_SQLITE)
|
||||||
|
spdlog::shutdown();
|
||||||
#if defined(PROJECT_ENABLE_SPDLOG)
|
|
||||||
if (spdlog_initialized) {
|
|
||||||
spdlog::shutdown();
|
|
||||||
spdlog_initialized = false;
|
|
||||||
}
|
|
||||||
#endif // defined(PROJECT_ENABLE_SPDLOG)
|
|
||||||
}
|
}
|
||||||
} // namespace repertory
|
} // namespace repertory
|
||||||
|
@@ -209,18 +209,10 @@ auto s3_provider::create_directory_paths(const std::string &api_path,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::uint64_t last_modified{};
|
|
||||||
if (exists) {
|
|
||||||
res = get_last_modified(true, cur_path, last_modified);
|
|
||||||
if (res != api_error::success) {
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
last_modified = utils::time::get_time_now();
|
|
||||||
}
|
|
||||||
|
|
||||||
auto dir{
|
auto dir{
|
||||||
create_api_file(cur_path, cur_key, 0U, last_modified),
|
create_api_file(cur_path, cur_key, 0U,
|
||||||
|
exists ? get_last_modified(true, cur_path)
|
||||||
|
: utils::time::get_time_now()),
|
||||||
};
|
};
|
||||||
get_api_item_added()(true, dir);
|
get_api_item_added()(true, dir);
|
||||||
}
|
}
|
||||||
@@ -632,19 +624,16 @@ auto s3_provider::get_file_list(api_file_list &list, std::string &marker) const
|
|||||||
return api_error::error;
|
return api_error::error;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto s3_provider::get_last_modified(bool directory, const std::string &api_path,
|
auto s3_provider::get_last_modified(bool directory,
|
||||||
std::uint64_t &last_modified) const
|
const std::string &api_path) const
|
||||||
-> api_error {
|
-> std::uint64_t {
|
||||||
bool is_encrypted{};
|
bool is_encrypted{};
|
||||||
std::string object_name;
|
std::string object_name;
|
||||||
head_object_result result{};
|
head_object_result result{};
|
||||||
auto res =
|
return (get_object_info(directory, api_path, is_encrypted, object_name,
|
||||||
get_object_info(directory, api_path, is_encrypted, object_name, result);
|
result) == api_error::success)
|
||||||
if (res == api_error::success) {
|
? result.last_modified
|
||||||
last_modified = result.last_modified;
|
: utils::time::get_time_now();
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto s3_provider::get_object_info(bool directory, const std::string &api_path,
|
auto s3_provider::get_object_info(bool directory, const std::string &api_path,
|
||||||
@@ -848,7 +837,6 @@ auto s3_provider::read_file_bytes(const std::string &api_path, std::size_t size,
|
|||||||
++idx) {
|
++idx) {
|
||||||
if (idx > 0U) {
|
if (idx > 0U) {
|
||||||
read_buffer.clear();
|
read_buffer.clear();
|
||||||
|
|
||||||
std::this_thread::sleep_for(1s);
|
std::this_thread::sleep_for(1s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -691,34 +691,32 @@ auto sia_provider::read_file_bytes(const std::string &api_path,
|
|||||||
res != api_error::success &&
|
res != api_error::success &&
|
||||||
idx < get_config().get_retry_read_count() + 1U;
|
idx < get_config().get_retry_read_count() + 1U;
|
||||||
++idx) {
|
++idx) {
|
||||||
if (idx > 0U) {
|
long response_code{};
|
||||||
buffer.clear();
|
const auto notify_retry = [&]() {
|
||||||
std::this_thread::sleep_for(1s);
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto notify_retry = [=](long response_code) {
|
|
||||||
auto msg =
|
|
||||||
fmt::format("read file bytes failed|offset|{}|size|{}|retry|{}",
|
|
||||||
std::to_string(offset), std::to_string(size),
|
|
||||||
std::to_string(idx + 1U));
|
|
||||||
if (response_code == 0) {
|
if (response_code == 0) {
|
||||||
utils::error::raise_api_path_error(function_name, api_path,
|
utils::error::raise_api_path_error(
|
||||||
api_error::comm_error, msg);
|
function_name, api_path, api_error::comm_error,
|
||||||
|
"read file bytes failed|offset|" + std::to_string(offset) +
|
||||||
|
"|size|" + std::to_string(size) + "|retry|" +
|
||||||
|
std::to_string(idx + 1U));
|
||||||
} else {
|
} else {
|
||||||
utils::error::raise_api_path_error(function_name, api_path,
|
utils::error::raise_api_path_error(
|
||||||
response_code, msg);
|
function_name, api_path, response_code,
|
||||||
|
"read file bytes failed|offset|" + std::to_string(offset) +
|
||||||
|
"|size|" + std::to_string(size) + "|retry|" +
|
||||||
|
std::to_string(idx + 1U));
|
||||||
}
|
}
|
||||||
|
std::this_thread::sleep_for(1s);
|
||||||
};
|
};
|
||||||
|
|
||||||
long response_code{};
|
|
||||||
if (not get_comm().make_request(get, response_code, stop_requested)) {
|
if (not get_comm().make_request(get, response_code, stop_requested)) {
|
||||||
notify_retry(response_code);
|
notify_retry();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response_code < http_error_codes::ok ||
|
if (response_code < http_error_codes::ok ||
|
||||||
response_code >= http_error_codes::multiple_choices) {
|
response_code >= http_error_codes::multiple_choices) {
|
||||||
notify_retry(response_code);
|
notify_retry();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -230,7 +230,7 @@ auto api_error_from_string(std::string_view str) -> api_error {
|
|||||||
return iter == LOOKUP.end() ? api_error::error : iter->first;
|
return iter == LOOKUP.end() ? api_error::error : iter->first;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto api_error_to_string(api_error error) -> const std::string & {
|
auto api_error_to_string(const api_error &error) -> const std::string & {
|
||||||
if (LOOKUP.size() != static_cast<std::size_t>(api_error::ERROR_COUNT)) {
|
if (LOOKUP.size() != static_cast<std::size_t>(api_error::ERROR_COUNT)) {
|
||||||
throw startup_exception("undefined api_error strings");
|
throw startup_exception("undefined api_error strings");
|
||||||
}
|
}
|
||||||
|
@@ -87,7 +87,7 @@ void raise_error(std::string_view function, std::string_view msg) {
|
|||||||
function, static_cast<std::string>(msg));
|
function, static_cast<std::string>(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void raise_error(std::string_view function, api_error err,
|
void raise_error(std::string_view function, const api_error &err,
|
||||||
std::string_view msg) {
|
std::string_view msg) {
|
||||||
event_system::instance().raise<repertory_exception>(
|
event_system::instance().raise<repertory_exception>(
|
||||||
function,
|
function,
|
||||||
@@ -121,7 +121,7 @@ void raise_error(std::string_view function, std::int64_t err,
|
|||||||
function, static_cast<std::string>(msg) + "|err|" + std::to_string(err));
|
function, static_cast<std::string>(msg) + "|err|" + std::to_string(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
void raise_error(std::string_view function, api_error err,
|
void raise_error(std::string_view function, const api_error &err,
|
||||||
std::string_view file_path, std::string_view msg) {
|
std::string_view file_path, std::string_view msg) {
|
||||||
event_system::instance().raise<repertory_exception>(
|
event_system::instance().raise<repertory_exception>(
|
||||||
function, static_cast<std::string>(msg) + "|sp|" +
|
function, static_cast<std::string>(msg) + "|sp|" +
|
||||||
@@ -147,7 +147,7 @@ void raise_error(std::string_view function, const std::exception &exception,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||||
api_error err, std::string_view msg) {
|
const api_error &err, std::string_view msg) {
|
||||||
event_system::instance().raise<repertory_exception>(
|
event_system::instance().raise<repertory_exception>(
|
||||||
function, static_cast<std::string>(msg) + "|ap|" +
|
function, static_cast<std::string>(msg) + "|ap|" +
|
||||||
static_cast<std::string>(api_path) + "|err|" +
|
static_cast<std::string>(api_path) + "|err|" +
|
||||||
@@ -181,7 +181,7 @@ void raise_api_path_error(std::string_view function, std::string_view api_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
void raise_api_path_error(std::string_view function, std::string_view api_path,
|
||||||
std::string_view source_path, api_error err,
|
std::string_view source_path, const api_error &err,
|
||||||
std::string_view msg) {
|
std::string_view msg) {
|
||||||
event_system::instance().raise<repertory_exception>(
|
event_system::instance().raise<repertory_exception>(
|
||||||
function, static_cast<std::string>(msg) + "|ap|" +
|
function, static_cast<std::string>(msg) + "|ap|" +
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include "utils/error_utils.hpp"
|
#include "utils/error_utils.hpp"
|
||||||
|
|
||||||
namespace repertory::utils {
|
namespace repertory::utils {
|
||||||
auto from_api_error(api_error err) -> int {
|
auto from_api_error(const api_error &err) -> int {
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case api_error::access_denied:
|
case api_error::access_denied:
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace repertory::utils {
|
namespace repertory::utils {
|
||||||
auto from_api_error(api_error e) -> NTSTATUS {
|
auto from_api_error(const api_error &e) -> NTSTATUS {
|
||||||
switch (e) {
|
switch (e) {
|
||||||
case api_error::access_denied:
|
case api_error::access_denied:
|
||||||
return STATUS_ACCESS_DENIED;
|
return STATUS_ACCESS_DENIED;
|
||||||
|
@@ -37,7 +37,7 @@ auto main(int argc, char **argv) -> int {
|
|||||||
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||||
|
|
||||||
if (not repertory::project_initialize()) {
|
if (not repertory::project_initialize()) {
|
||||||
repertory::project_cleanup();
|
std::cerr << "fatal: failed to initialize repertory" << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -119,10 +119,7 @@ handlers::handlers(mgmt_app_config *config, httplib::Server *server)
|
|||||||
setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
|
setsockopt(sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE,
|
||||||
reinterpret_cast<const char *>(&enable), sizeof(enable));
|
reinterpret_cast<const char *>(&enable), sizeof(enable));
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
linger opt{
|
linger opt{1, 0};
|
||||||
.l_onoff = 1,
|
|
||||||
.l_linger = 0,
|
|
||||||
};
|
|
||||||
setsockopt(sock, SOL_SOCKET, SO_LINGER,
|
setsockopt(sock, SOL_SOCKET, SO_LINGER,
|
||||||
reinterpret_cast<const char *>(&opt), sizeof(opt));
|
reinterpret_cast<const char *>(&opt), sizeof(opt));
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
@@ -721,7 +718,6 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
|
|||||||
args.insert(std::next(args.begin(), 4U), "/MIN");
|
args.insert(std::next(args.begin(), 4U), "/MIN");
|
||||||
args.insert(std::next(args.begin(), 5U), repertory_binary_);
|
args.insert(std::next(args.begin(), 5U), repertory_binary_);
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
args.insert(args.begin(), "-f");
|
|
||||||
args.insert(args.begin(), repertory_binary_);
|
args.insert(args.begin(), repertory_binary_);
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
@@ -737,35 +733,21 @@ auto handlers::launch_process(provider_type prov, std::string_view name,
|
|||||||
const_cast<char *const *>(exec_args.data()));
|
const_cast<char *const *>(exec_args.data()));
|
||||||
#else // !defined(_WIN32)
|
#else // !defined(_WIN32)
|
||||||
auto pid = fork();
|
auto pid = fork();
|
||||||
if (pid < 0) {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pid == 0) {
|
if (pid == 0) {
|
||||||
signal(SIGCHLD, SIG_DFL);
|
setsid();
|
||||||
|
chdir("/");
|
||||||
if (setsid() < 0) {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
close(STDIN_FILENO);
|
close(STDIN_FILENO);
|
||||||
close(STDOUT_FILENO);
|
close(STDOUT_FILENO);
|
||||||
close(STDERR_FILENO);
|
close(STDERR_FILENO);
|
||||||
|
open("/dev/null", O_RDONLY);
|
||||||
|
open("/dev/null", O_WRONLY);
|
||||||
|
open("/dev/null", O_WRONLY);
|
||||||
|
|
||||||
if (open("/dev/null", O_RDONLY) != 0 ||
|
|
||||||
open("/dev/null", O_WRONLY) != 1 ||
|
|
||||||
open("/dev/null", O_WRONLY) != 2) {
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
chdir(utils::path::get_parent_path(repertory_binary_).c_str());
|
|
||||||
execvp(exec_args.at(0U), const_cast<char *const *>(exec_args.data()));
|
execvp(exec_args.at(0U), const_cast<char *const *>(exec_args.data()));
|
||||||
exit(1);
|
|
||||||
} else {
|
} else {
|
||||||
signal(SIGCHLD, SIG_IGN);
|
signal(SIGCHLD, SIG_IGN);
|
||||||
}
|
}
|
||||||
#endif // defined(_WIN32)
|
#endif // defined(_WIN32)
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,32 +25,23 @@
|
|||||||
|
|
||||||
#include "initialize.hpp"
|
#include "initialize.hpp"
|
||||||
#include "test_common.hpp"
|
#include "test_common.hpp"
|
||||||
#include "utils/error.hpp"
|
|
||||||
|
|
||||||
using namespace repertory;
|
using namespace repertory;
|
||||||
|
|
||||||
int PROJECT_TEST_RESULT{0};
|
int PROJECT_TEST_RESULT{0};
|
||||||
|
|
||||||
auto main(int argc, char **argv) -> int {
|
auto main(int argc, char **argv) -> int {
|
||||||
REPERTORY_USES_FUNCTION_NAME();
|
|
||||||
|
|
||||||
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
#if defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||||
static backward::SignalHandling sh;
|
static backward::SignalHandling sh;
|
||||||
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
#endif // defined(PROJECT_ENABLE_BACKWARD_CPP)
|
||||||
|
|
||||||
if (not repertory::project_initialize()) {
|
if (not repertory::project_initialize()) {
|
||||||
repertory::project_cleanup();
|
std::cerr << "fatal: failed to initialize repertory" << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
PROJECT_TEST_RESULT = RUN_ALL_TESTS();
|
||||||
PROJECT_TEST_RESULT = RUN_ALL_TESTS();
|
|
||||||
} catch (const std::exception &e) {
|
|
||||||
utils::error::handle_exception(function_name, e);
|
|
||||||
} catch (...) {
|
|
||||||
utils::error::handle_exception(function_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
repertory::project_cleanup();
|
repertory::project_cleanup();
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ protected:
|
|||||||
std::atomic<std::size_t> open_file_test::inst{0U};
|
std::atomic<std::size_t> open_file_test::inst{0U};
|
||||||
|
|
||||||
static void test_closeable_open_file(const open_file &file, bool directory,
|
static void test_closeable_open_file(const open_file &file, bool directory,
|
||||||
api_error err, std::uint64_t size,
|
const api_error &err, std::uint64_t size,
|
||||||
const std::string &source_path) {
|
const std::string &source_path) {
|
||||||
EXPECT_EQ(directory, file.is_directory());
|
EXPECT_EQ(directory, file.is_directory());
|
||||||
EXPECT_EQ(err, file.get_api_error());
|
EXPECT_EQ(err, file.get_api_error());
|
||||||
|
@@ -8,7 +8,7 @@ constexpr std::string_view version =
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace repertory {
|
namespace repertory {
|
||||||
auto project_get_git_rev() -> std::string_view { return git_rev; }
|
auto project_get_git_rev() -> std::string_view { return git_rev; }
|
||||||
|
|
||||||
auto project_get_version() -> std::string_view { return version; }
|
auto project_get_version() -> std::string_view { return version; }
|
||||||
} // namespace %PROJECT_NAME %
|
} // namespace repertory
|
||||||
|
@@ -194,7 +194,7 @@ if [ "${PROJECT_ENABLE_WINFSP}" == "ON" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${WINFSP_DLL_PART}" != "" ]; then
|
if [ "${WINFSP_DLL_PART}" != "" ]; then
|
||||||
PROJECT_MINGW64_COPY_DEPENDENCIES+=(${PROJECT_3RD_PARTY_DIR}/winfsp-2.1/bin/winfsp-${WINFSP_DLL_PART}.dll)
|
PROJECT_MINGW64_COPY_DEPENDENCIES+=(${PROJECT_3RD_PARTY_DIR}/winfsp-2.0/bin/winfsp-${WINFSP_DLL_PART}.dll)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ PROJECT_DOWNLOADS[BOOST]="https://archives.boost.io/release/${PROJECT_VERSIONS[B
|
|||||||
PROJECT_DOWNLOADS[CPP_HTTPLIB]="https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${PROJECT_VERSIONS[CPP_HTTPLIB]}.tar.gz;cpp-httplib-${PROJECT_VERSIONS[CPP_HTTPLIB]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[CPP_HTTPLIB]="https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${PROJECT_VERSIONS[CPP_HTTPLIB]}.tar.gz;cpp-httplib-${PROJECT_VERSIONS[CPP_HTTPLIB]}.tar.gz;3rd_party"
|
||||||
PROJECT_DOWNLOADS[CURL]="https://github.com/curl/curl/archive/refs/tags/curl-${PROJECT_VERSIONS[CURL2]}.tar.gz;curl-${PROJECT_VERSIONS[CURL]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[CURL]="https://github.com/curl/curl/archive/refs/tags/curl-${PROJECT_VERSIONS[CURL2]}.tar.gz;curl-${PROJECT_VERSIONS[CURL]}.tar.gz;3rd_party"
|
||||||
PROJECT_DOWNLOADS[EXPAT]="https://github.com/libexpat/libexpat/archive/refs/tags/R_${PROJECT_VERSIONS[EXPAT2]}.tar.gz;expat-${PROJECT_VERSIONS[EXPAT]}.tar.gz;3rd_party/mingw64"
|
PROJECT_DOWNLOADS[EXPAT]="https://github.com/libexpat/libexpat/archive/refs/tags/R_${PROJECT_VERSIONS[EXPAT2]}.tar.gz;expat-${PROJECT_VERSIONS[EXPAT]}.tar.gz;3rd_party/mingw64"
|
||||||
PROJECT_DOWNLOADS[GCC]="https://mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-${PROJECT_VERSIONS[GCC]}/gcc-${PROJECT_VERSIONS[GCC]}.tar.gz;gcc-${PROJECT_VERSIONS[GCC]}.tar.gz;3rd_party/mingw64"
|
PROJECT_DOWNLOADS[GCC]="https://ftp.gnu.org/gnu/gcc/gcc-${PROJECT_VERSIONS[GCC]}/gcc-${PROJECT_VERSIONS[GCC]}.tar.gz;gcc-${PROJECT_VERSIONS[GCC]}.tar.gz;3rd_party/mingw64"
|
||||||
PROJECT_DOWNLOADS[GTEST]="https://github.com/google/googletest/archive/refs/tags/v${PROJECT_VERSIONS[GTEST]}.tar.gz;googletest-${PROJECT_VERSIONS[GTEST]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[GTEST]="https://github.com/google/googletest/archive/refs/tags/v${PROJECT_VERSIONS[GTEST]}.tar.gz;googletest-${PROJECT_VERSIONS[GTEST]}.tar.gz;3rd_party"
|
||||||
PROJECT_DOWNLOADS[ICU]="https://github.com/unicode-org/icu/archive/refs/tags/release-${PROJECT_VERSIONS[ICU]}.tar.gz;icu-release-${PROJECT_VERSIONS[ICU]}.tar.gz;3rd_party/mingw64"
|
PROJECT_DOWNLOADS[ICU]="https://github.com/unicode-org/icu/archive/refs/tags/release-${PROJECT_VERSIONS[ICU]}.tar.gz;icu-release-${PROJECT_VERSIONS[ICU]}.tar.gz;3rd_party/mingw64"
|
||||||
PROJECT_DOWNLOADS[JSON]="https://github.com/nlohmann/json/archive/refs/tags/v${PROJECT_VERSIONS[JSON]}.tar.gz;json-${PROJECT_VERSIONS[JSON]}.tar.gz;3rd_party"
|
PROJECT_DOWNLOADS[JSON]="https://github.com/nlohmann/json/archive/refs/tags/v${PROJECT_VERSIONS[JSON]}.tar.gz;json-${PROJECT_VERSIONS[JSON]}.tar.gz;3rd_party"
|
||||||
|
@@ -8,24 +8,24 @@ PROJECT_VERSIONS[BOOST2_PATCH]="0"
|
|||||||
PROJECT_VERSIONS[BOOST_MAJOR]="1"
|
PROJECT_VERSIONS[BOOST_MAJOR]="1"
|
||||||
PROJECT_VERSIONS[BOOST_MINOR]="88"
|
PROJECT_VERSIONS[BOOST_MINOR]="88"
|
||||||
PROJECT_VERSIONS[BOOST_PATCH]="0"
|
PROJECT_VERSIONS[BOOST_PATCH]="0"
|
||||||
PROJECT_VERSIONS[CPP_HTTPLIB]="0.23.1"
|
PROJECT_VERSIONS[CPP_HTTPLIB]="0.20.0"
|
||||||
PROJECT_VERSIONS[CURL]="8.15.0"
|
PROJECT_VERSIONS[CURL]="8.13.0"
|
||||||
PROJECT_VERSIONS[CURL2]="8_15_0"
|
PROJECT_VERSIONS[CURL2]="8_13_0"
|
||||||
PROJECT_VERSIONS[EXPAT]="2.7.1"
|
PROJECT_VERSIONS[EXPAT]="2.7.1"
|
||||||
PROJECT_VERSIONS[EXPAT2]="2_7_1"
|
PROJECT_VERSIONS[EXPAT2]="2_7_1"
|
||||||
PROJECT_VERSIONS[GCC]="15.1.0"
|
PROJECT_VERSIONS[GCC]="14.2.0"
|
||||||
PROJECT_VERSIONS[GTEST]="1.17.0"
|
PROJECT_VERSIONS[GTEST]="1.16.0"
|
||||||
PROJECT_VERSIONS[ICU]="76-1"
|
PROJECT_VERSIONS[ICU]="76-1"
|
||||||
PROJECT_VERSIONS[JSON]="3.12.0"
|
PROJECT_VERSIONS[JSON]="3.12.0"
|
||||||
PROJECT_VERSIONS[LIBSODIUM]="1.0.20"
|
PROJECT_VERSIONS[LIBSODIUM]="1.0.20"
|
||||||
PROJECT_VERSIONS[MINGW]="13.0.0"
|
PROJECT_VERSIONS[MINGW]="12.0.0"
|
||||||
PROJECT_VERSIONS[OPENSSL]="3.5.1"
|
PROJECT_VERSIONS[OPENSSL]="3.5.0"
|
||||||
PROJECT_VERSIONS[PKG_CONFIG]="0.29.2"
|
PROJECT_VERSIONS[PKG_CONFIG]="0.29.2"
|
||||||
PROJECT_VERSIONS[PUGIXML]="1.15"
|
PROJECT_VERSIONS[PUGIXML]="1.15"
|
||||||
PROJECT_VERSIONS[ROCKSDB]="10.4.2"
|
PROJECT_VERSIONS[ROCKSDB]="10.0.1"
|
||||||
PROJECT_VERSIONS[SPDLOG]="1.15.3"
|
PROJECT_VERSIONS[SPDLOG]="1.15.2"
|
||||||
PROJECT_VERSIONS[SQLITE]="3500300"
|
PROJECT_VERSIONS[SQLITE]="3490100"
|
||||||
PROJECT_VERSIONS[SQLITE2]="3.50.3"
|
PROJECT_VERSIONS[SQLITE2]="3.49.1"
|
||||||
PROJECT_VERSIONS[STDUUID]="1.2.3"
|
PROJECT_VERSIONS[STDUUID]="1.2.3"
|
||||||
PROJECT_VERSIONS[ZLIB]="1.3.1"
|
PROJECT_VERSIONS[ZLIB]="1.3.1"
|
||||||
export PROJECT_VERSIONS
|
export PROJECT_VERSIONS
|
||||||
|
BIN
support/3rd_party/cpp-httplib-0.20.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/cpp-httplib-0.20.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/cpp-httplib-0.20.0.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/cpp-httplib-0.20.0.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
18064587e0cc6a0d5d56d619f4cbbcaba47aa5d84d86013abbd45d95c6653866 cpp-httplib-0.20.0.tar.gz
|
BIN
support/3rd_party/cpp-httplib-0.23.1.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/cpp-httplib-0.23.1.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
410a1347ed6bcbcc4a19af8ed8ad3873fe9fa97731d52db845c4c78f3f9c31e6 cpp-httplib-0.23.1.tar.gz
|
|
BIN
support/3rd_party/curl-8.13.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/curl-8.13.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/curl-8.13.0.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/curl-8.13.0.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ccc5ba45d9f5320c70ffb24e5411b66ba55ea1f333bf78be0963ed90a9328699 curl-8.13.0.tar.gz
|
BIN
support/3rd_party/curl-8.15.0.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/curl-8.15.0.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
1
support/3rd_party/curl-8.15.0.tar.gz.sha256
vendored
1
support/3rd_party/curl-8.15.0.tar.gz.sha256
vendored
@@ -1 +0,0 @@
|
|||||||
2937cadde007aa3a52a17c21ac9153ea054700f37926d1d96602bf07e888c847 curl-8.15.0.tar.gz
|
|
BIN
support/3rd_party/googletest-1.15.2.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/googletest-1.15.2.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/googletest-1.15.2.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/googletest-1.15.2.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
7b42b4d6ed48810c5362c265a17faebe90dc2373c885e5216439d37927f02926 googletest-1.15.2.tar.gz
|
BIN
support/3rd_party/googletest-1.16.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/googletest-1.16.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/googletest-1.16.0.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/googletest-1.16.0.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
78c676fc63881529bf97bf9d45948d905a66833fbfa5318ea2cd7478cb98f399 *googletest-1.16.0.tar.gz
|
BIN
support/3rd_party/googletest-1.17.0.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/googletest-1.17.0.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c googletest-1.17.0.tar.gz
|
|
BIN
support/3rd_party/mingw64/gcc-14.2.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/mingw64/gcc-14.2.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/mingw64/gcc-14.2.0.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/mingw64/gcc-14.2.0.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
7d376d445f93126dc545e2c0086d0f647c3094aae081cdb78f42ce2bc25e7293 gcc-14.2.0.tar.gz
|
BIN
support/3rd_party/mingw64/gcc-15.1.0.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/mingw64/gcc-15.1.0.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
51b9919ea69c980d7a381db95d4be27edf73b21254eb13d752a08003b4d013b1 *gcc-15.1.0.tar.gz
|
|
Binary file not shown.
1
support/3rd_party/mingw64/mingw-w64-v12.0.0.tar.bz2.sha256
vendored
Normal file
1
support/3rd_party/mingw64/mingw-w64-v12.0.0.tar.bz2.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cc41898aac4b6e8dd5cffd7331b9d9515b912df4420a3a612b5ea2955bbeed2f mingw-w64-v12.0.0.tar.bz2
|
@@ -1 +0,0 @@
|
|||||||
5afe822af5c4edbf67daaf45eec61d538f49eef6b19524de64897c6b95828caf mingw-w64-v13.0.0.tar.bz2
|
|
BIN
support/3rd_party/openssl-3.5.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/openssl-3.5.0.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/openssl-3.5.0.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/openssl-3.5.0.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0 openssl-3.5.0.tar.gz
|
BIN
support/3rd_party/openssl-3.5.1.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/openssl-3.5.1.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
529043b15cffa5f36077a4d0af83f3de399807181d607441d734196d889b641f openssl-3.5.1.tar.gz
|
|
BIN
support/3rd_party/rocksdb-10.0.1.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/rocksdb-10.0.1.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/rocksdb-10.0.1.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/rocksdb-10.0.1.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
3fdc9ca996971c4c039959866382c4a3a6c8ade4abf888f3b2ff77153e07bf28 rocksdb-10.0.1.tar.gz
|
BIN
support/3rd_party/rocksdb-10.4.2.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/rocksdb-10.4.2.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
afccfab496556904900afacf7d99887f1d50cb893e5d2288bd502db233adacac rocksdb-10.4.2.tar.gz
|
|
BIN
support/3rd_party/spdlog-1.15.2.tar.gz
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/spdlog-1.15.2.tar.gz
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/spdlog-1.15.2.tar.gz.sha256
vendored
Normal file
1
support/3rd_party/spdlog-1.15.2.tar.gz.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
7a80896357f3e8e920e85e92633b14ba0f229c506e6f978578bdc35ba09e9a5d spdlog-1.15.2.tar.gz
|
BIN
support/3rd_party/spdlog-1.15.3.tar.gz
(Stored with Git LFS)
vendored
BIN
support/3rd_party/spdlog-1.15.3.tar.gz
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67 spdlog-1.15.3.tar.gz
|
|
BIN
support/3rd_party/sqlite-amalgamation-3490100.zip
(Stored with Git LFS)
vendored
Normal file
BIN
support/3rd_party/sqlite-amalgamation-3490100.zip
(Stored with Git LFS)
vendored
Normal file
Binary file not shown.
1
support/3rd_party/sqlite-amalgamation-3490100.zip.sha256
vendored
Normal file
1
support/3rd_party/sqlite-amalgamation-3490100.zip.sha256
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
6cebd1d8403fc58c30e93939b246f3e6e58d0765a5cd50546f16c00fd805d2c3 *sqlite-amalgamation-3490100.zip
|
BIN
support/3rd_party/sqlite-amalgamation-3500300.zip
(Stored with Git LFS)
vendored
BIN
support/3rd_party/sqlite-amalgamation-3500300.zip
(Stored with Git LFS)
vendored
Binary file not shown.
@@ -1 +0,0 @@
|
|||||||
9ad6d16cbc1df7cd55c8b55127c82a9bca5e9f287818de6dc87e04e73599d754 sqlite-amalgamation-3500300.zip
|
|
File diff suppressed because it is too large
Load Diff
@@ -1,54 +1,54 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
|
|
||||||
REM Determine the SxS (side-by-side) identifier.
|
REM Determine the SxS (side-by-side) identifier.
|
||||||
set SxsDir=
|
set SxsDir=
|
||||||
set RegKey="HKLM\SOFTWARE\WinFsp"
|
set RegKey="HKLM\SOFTWARE\WinFsp"
|
||||||
set RegVal="SxsDir"
|
set RegVal="SxsDir"
|
||||||
reg query !RegKey! /v !RegVal! /reg:32 >nul 2>&1
|
reg query !RegKey! /v !RegVal! /reg:32 >nul 2>&1
|
||||||
if !ERRORLEVEL! equ 0 (
|
if !ERRORLEVEL! equ 0 (
|
||||||
for /f "tokens=2,*" %%i in ('reg query !RegKey! /v !RegVal! /reg:32 ^| findstr !RegVal!') do (
|
for /f "tokens=2,*" %%i in ('reg query !RegKey! /v !RegVal! /reg:32 ^| findstr !RegVal!') do (
|
||||||
set SxsDir=%%j
|
set SxsDir=%%j
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
set SxsSuffix=
|
set SxsSuffix=
|
||||||
if defined SxsDir (
|
if defined SxsDir (
|
||||||
set SxsSuffix=!SxsDir:*SxS\sxs.=!
|
set SxsSuffix=!SxsDir:*SxS\sxs.=!
|
||||||
if !SxsSuffix:~-1!==\ set SxsSuffix=!SxsSuffix:~0,-1!
|
if !SxsSuffix:~-1!==\ set SxsSuffix=!SxsSuffix:~0,-1!
|
||||||
set SxsSuffix=+!SxsSuffix!
|
set SxsSuffix=+!SxsSuffix!
|
||||||
)
|
)
|
||||||
|
|
||||||
echo WINFSP FSD
|
echo WINFSP FSD
|
||||||
sc query WinFsp!SxsSuffix!
|
sc query WinFsp!SxsSuffix!
|
||||||
sc qc WinFsp!SxsSuffix!
|
sc qc WinFsp!SxsSuffix!
|
||||||
sc sdshow WinFsp!SxsSuffix!
|
sc sdshow WinFsp!SxsSuffix!
|
||||||
echo.
|
echo.
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
echo WINFSP DLL
|
echo WINFSP DLL
|
||||||
reg query HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
|
reg query HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
|
||||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\WinFsp.Np\NetworkProvider
|
reg query HKLM\SYSTEM\CurrentControlSet\Services\WinFsp.Np\NetworkProvider
|
||||||
reg query HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\WinFsp
|
reg query HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\WinFsp
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
echo WINFSP LAUNCHER
|
echo WINFSP LAUNCHER
|
||||||
sc query WinFsp.Launcher
|
sc query WinFsp.Launcher
|
||||||
sc qc WinFsp.Launcher
|
sc qc WinFsp.Launcher
|
||||||
sc sdshow WinFsp.Launcher
|
sc sdshow WinFsp.Launcher
|
||||||
echo.
|
echo.
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
echo WINFSP REGISTRY
|
echo WINFSP REGISTRY
|
||||||
reg query HKLM\SOFTWARE\WinFsp /s /reg:32
|
reg query HKLM\SOFTWARE\WinFsp /s /reg:32
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
echo FILE SYSTEM FILTERS (REQUIRES ADMINISTRATOR)
|
echo FILE SYSTEM FILTERS (REQUIRES ADMINISTRATOR)
|
||||||
fltmc filters
|
fltmc filters
|
||||||
echo.
|
echo.
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
echo OS INFORMATION
|
echo OS INFORMATION
|
||||||
systeminfo
|
systeminfo
|
||||||
echo.
|
echo.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,42 +1,42 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
setlocal
|
setlocal
|
||||||
setlocal EnableDelayedExpansion
|
setlocal EnableDelayedExpansion
|
||||||
|
|
||||||
set RegKey=HKLM\Software\WinFsp\Services
|
set RegKey=HKLM\Software\WinFsp\Services
|
||||||
|
|
||||||
if not X%1==X-u (
|
if not X%1==X-u (
|
||||||
set unreg=0
|
set unreg=0
|
||||||
|
|
||||||
if not X%1==X set fsname=%1
|
if not X%1==X set fsname=%1
|
||||||
if not X%2==X set fsexec="%~f2"
|
if not X%2==X set fsexec="%~f2"
|
||||||
if not X%3==X set fscmdl=%3
|
if not X%3==X set fscmdl=%3
|
||||||
if not X%4==X set fssecu=%4
|
if not X%4==X set fssecu=%4
|
||||||
|
|
||||||
if X!fscmdl!==X goto usage
|
if X!fscmdl!==X goto usage
|
||||||
if not exist !fsexec! goto notfound
|
if not exist !fsexec! goto notfound
|
||||||
|
|
||||||
reg add !RegKey!\!fsname! /v Executable /t REG_SZ /d !fsexec! /f /reg:32
|
reg add !RegKey!\!fsname! /v Executable /t REG_SZ /d !fsexec! /f /reg:32
|
||||||
reg add !RegKey!\!fsname! /v CommandLine /t REG_SZ /d !fscmdl! /f /reg:32
|
reg add !RegKey!\!fsname! /v CommandLine /t REG_SZ /d !fscmdl! /f /reg:32
|
||||||
reg add !RegKey!\!fsname! /v JobControl /t REG_DWORD /d 1 /f /reg:32
|
reg add !RegKey!\!fsname! /v JobControl /t REG_DWORD /d 1 /f /reg:32
|
||||||
if not X!fssecu!==X reg add !RegKey!\!fsname! /v Security /t REG_SZ /d !fssecu! /f /reg:32
|
if not X!fssecu!==X reg add !RegKey!\!fsname! /v Security /t REG_SZ /d !fssecu! /f /reg:32
|
||||||
) else (
|
) else (
|
||||||
set unreg=1
|
set unreg=1
|
||||||
|
|
||||||
if not X%2==X set fsname=%2
|
if not X%2==X set fsname=%2
|
||||||
|
|
||||||
if X!fsname!==X goto usage
|
if X!fsname!==X goto usage
|
||||||
|
|
||||||
reg delete !RegKey!\!fsname! /f /reg:32
|
reg delete !RegKey!\!fsname! /f /reg:32
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b 0
|
exit /b 0
|
||||||
|
|
||||||
:notfound
|
:notfound
|
||||||
echo executable !fsexec! not found >&2
|
echo executable !fsexec! not found >&2
|
||||||
exit /b 2
|
exit /b 2
|
||||||
|
|
||||||
:usage
|
:usage
|
||||||
echo usage: fsreg NAME EXECUTABLE COMMANDLINE [SECURITY] >&2
|
echo usage: fsreg NAME EXECUTABLE COMMANDLINE [SECURITY] >&2
|
||||||
echo usage: fsreg -u NAME >&2
|
echo usage: fsreg -u NAME >&2
|
||||||
exit /b 2
|
exit /b 2
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
support/3rd_party/winfsp-2.0/bin/memfs-a64.exe
vendored
Normal file
BIN
support/3rd_party/winfsp-2.0/bin/memfs-a64.exe
vendored
Normal file
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user