revert
All checks were successful
BlockStorage/repertory_linux_builds/pipeline/head This commit looks good
BlockStorage/repertory_osx_builds/pipeline/head This commit looks good

This commit is contained in:
Scott E. Graves 2024-01-29 11:36:26 -06:00
parent d175a38ad1
commit 99533a9687
213 changed files with 43429 additions and 41103 deletions

View File

@ -156,6 +156,7 @@ ncrypt
netdev netdev
nlohmann nlohmann
nmake nmake
nmakeprg
noappledouble noappledouble
nocache nocache
nocloseprocess nocloseprocess
@ -165,6 +166,7 @@ nopath
npubbytes npubbytes
ntfs ntfs
ntstatus ntstatus
nv_darcula_enable_dap
nvimrc_cfg nvimrc_cfg
nypadymka nypadymka
oleaut32 oleaut32
@ -240,13 +242,16 @@ usermount
userprofile userprofile
utimens utimens
utimensat utimensat
waggressive
wcast wcast
wconversion wconversion
wdouble wdouble
wduplicated wduplicated
wfloat
wformat wformat
windres windres
winfsp winfsp
winfsp_allocation_unit
winfsp_drive winfsp_drive
winfspdrive winfspdrive
winhttp winhttp

195
3rd_party/cacert.pem vendored
View File

@ -1,7 +1,7 @@
## ##
## Bundle of CA Root Certificates ## Bundle of CA Root Certificates
## ##
## Certificate data from Mozilla as of: Tue Aug 22 03:12:04 2023 GMT ## Certificate data from Mozilla as of: Tue Dec 12 04:12:04 2023 GMT
## ##
## This is a bundle of X.509 certificates of public Certificate Authorities ## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates ## (CA). These were automatically extracted from Mozilla's root certificates
@ -14,7 +14,7 @@
## Just configure this file as the SSLCACertificateFile. ## Just configure this file as the SSLCACertificateFile.
## ##
## Conversion done with mk-ca-bundle.pl version 1.29. ## Conversion done with mk-ca-bundle.pl version 1.29.
## SHA256: 0ff137babc6a5561a9cfbe9f29558972e5b528202681b7d3803d03a3e82922bd ## SHA256: 1970dd65858925d68498d2356aea6d03f764422523c5887deca8ce3ba9e1f845
## ##
@ -200,27 +200,6 @@ vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr
qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto=
-----END CERTIFICATE----- -----END CERTIFICATE-----
Security Communication Root CA
==============================
-----BEGIN CERTIFICATE-----
MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP
U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw
8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM
DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX
5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd
DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2
JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw
DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g
0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a
mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ
s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ
6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi
FL39vmwLAw==
-----END CERTIFICATE-----
XRamp Global CA Root XRamp Global CA Root
==================== ====================
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
@ -669,39 +648,6 @@ YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r
kpeDMdmztcpHWD9f kpeDMdmztcpHWD9f
-----END CERTIFICATE----- -----END CERTIFICATE-----
Autoridad de Certificacion Firmaprofesional CIF A62634068
=========================================================
-----BEGIN CERTIFICATE-----
MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA
BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2
MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw
QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB
NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD
Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P
B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY
7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH
ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI
plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX
MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX
LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK
bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU
vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud
EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH
DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp
cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA
bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx
ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx
51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk
R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP
T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f
Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl
osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR
crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR
saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD
KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi
6Et8Vcad+qMUu2WFbm5PEn4KPJ2V
-----END CERTIFICATE-----
Izenpe.com Izenpe.com
========== ==========
-----BEGIN CERTIFICATE----- -----BEGIN CERTIFICATE-----
@ -3449,3 +3395,140 @@ TFsR0PXNor6uzFFcw9VUewyu1rkGd4Di7wcaaMxZUa1+XGdrudviB0JbuAEFWDlN5LuYo7Ey7Nmj
PqYO5Wue/9vsL3SD3460s6neFE3/MaNFcyT6lSnMEpcEoji2jbDwN/zIIX8/syQbPYtuzE2wFg2W PqYO5Wue/9vsL3SD3460s6neFE3/MaNFcyT6lSnMEpcEoji2jbDwN/zIIX8/syQbPYtuzE2wFg2W
HYMfRsCbvUOZ58SWLs5fyQ== HYMfRsCbvUOZ58SWLs5fyQ==
-----END CERTIFICATE----- -----END CERTIFICATE-----
TrustAsia Global Root CA G3
===========================
-----BEGIN CERTIFICATE-----
MIIFpTCCA42gAwIBAgIUZPYOZXdhaqs7tOqFhLuxibhxkw8wDQYJKoZIhvcNAQEMBQAwWjELMAkG
A1UEBhMCQ04xJTAjBgNVBAoMHFRydXN0QXNpYSBUZWNobm9sb2dpZXMsIEluYy4xJDAiBgNVBAMM
G1RydXN0QXNpYSBHbG9iYWwgUm9vdCBDQSBHMzAeFw0yMTA1MjAwMjEwMTlaFw00NjA1MTkwMjEw
MTlaMFoxCzAJBgNVBAYTAkNOMSUwIwYDVQQKDBxUcnVzdEFzaWEgVGVjaG5vbG9naWVzLCBJbmMu
MSQwIgYDVQQDDBtUcnVzdEFzaWEgR2xvYmFsIFJvb3QgQ0EgRzMwggIiMA0GCSqGSIb3DQEBAQUA
A4ICDwAwggIKAoICAQDAMYJhkuSUGwoqZdC+BqmHO1ES6nBBruL7dOoKjbmzTNyPtxNST1QY4Sxz
lZHFZjtqz6xjbYdT8PfxObegQ2OwxANdV6nnRM7EoYNl9lA+sX4WuDqKAtCWHwDNBSHvBm3dIZwZ
Q0WhxeiAysKtQGIXBsaqvPPW5vxQfmZCHzyLpnl5hkA1nyDvP+uLRx+PjsXUjrYsyUQE49RDdT/V
P68czH5GX6zfZBCK70bwkPAPLfSIC7Epqq+FqklYqL9joDiR5rPmd2jE+SoZhLsO4fWvieylL1Ag
dB4SQXMeJNnKziyhWTXAyB1GJ2Faj/lN03J5Zh6fFZAhLf3ti1ZwA0pJPn9pMRJpxx5cynoTi+jm
9WAPzJMshH/x/Gr8m0ed262IPfN2dTPXS6TIi/n1Q1hPy8gDVI+lhXgEGvNz8teHHUGf59gXzhqc
D0r83ERoVGjiQTz+LISGNzzNPy+i2+f3VANfWdP3kXjHi3dqFuVJhZBFcnAvkV34PmVACxmZySYg
WmjBNb9Pp1Hx2BErW+Canig7CjoKH8GB5S7wprlppYiU5msTf9FkPz2ccEblooV7WIQn3MSAPmea
mseaMQ4w7OYXQJXZRe0Blqq/DPNL0WP3E1jAuPP6Z92bfW1K/zJMtSU7/xxnD4UiWQWRkUF3gdCF
TIcQcf+eQxuulXUtgQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEDk5PIj
7zjKsK5Xf/IhMBY027ySMB0GA1UdDgQWBBRA5OTyI+84yrCuV3/yITAWNNu8kjAOBgNVHQ8BAf8E
BAMCAQYwDQYJKoZIhvcNAQEMBQADggIBACY7UeFNOPMyGLS0XuFlXsSUT9SnYaP4wM8zAQLpw6o1
D/GUE3d3NZ4tVlFEbuHGLige/9rsR82XRBf34EzC4Xx8MnpmyFq2XFNFV1pF1AWZLy4jVe5jaN/T
G3inEpQGAHUNcoTpLrxaatXeL1nHo+zSh2bbt1S1JKv0Q3jbSwTEb93mPmY+KfJLaHEih6D4sTNj
duMNhXJEIlU/HHzp/LgV6FL6qj6jITk1dImmasI5+njPtqzn59ZW/yOSLlALqbUHM/Q4X6RJpstl
cHboCoWASzY9M/eVVHUl2qzEc4Jl6VL1XP04lQJqaTDFHApXB64ipCz5xUG3uOyfT0gA+QEEVcys
+TIxxHWVBqB/0Y0n3bOppHKH/lmLmnp0Ft0WpWIp6zqW3IunaFnT63eROfjXy9mPX1onAX1daBli
2MjN9LdyR75bl87yraKZk62Uy5P2EgmVtqvXO9A/EcswFi55gORngS1d7XB4tmBZrOFdRWOPyN9y
aFvqHbgB8X7754qz41SgOAngPN5C8sLtLpvzHzW2NtjjgKGLzZlkD8Kqq7HK9W+eQ42EVJmzbsAS
ZthwEPEGNTNDqJwuuhQxzhB/HIbjj9LV+Hfsm6vxL2PZQl/gZ4FkkfGXL/xuJvYz+NO1+MRiqzFR
JQJ6+N1rZdVtTTDIZbpoFGWsJwt0ivKH
-----END CERTIFICATE-----
TrustAsia Global Root CA G4
===========================
-----BEGIN CERTIFICATE-----
MIICVTCCAdygAwIBAgIUTyNkuI6XY57GU4HBdk7LKnQV1tcwCgYIKoZIzj0EAwMwWjELMAkGA1UE
BhMCQ04xJTAjBgNVBAoMHFRydXN0QXNpYSBUZWNobm9sb2dpZXMsIEluYy4xJDAiBgNVBAMMG1Ry
dXN0QXNpYSBHbG9iYWwgUm9vdCBDQSBHNDAeFw0yMTA1MjAwMjEwMjJaFw00NjA1MTkwMjEwMjJa
MFoxCzAJBgNVBAYTAkNOMSUwIwYDVQQKDBxUcnVzdEFzaWEgVGVjaG5vbG9naWVzLCBJbmMuMSQw
IgYDVQQDDBtUcnVzdEFzaWEgR2xvYmFsIFJvb3QgQ0EgRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNi
AATxs8045CVD5d4ZCbuBeaIVXxVjAd7Cq92zphtnS4CDr5nLrBfbK5bKfFJV4hrhPVbwLxYI+hW8
m7tH5j/uqOFMjPXTNvk4XatwmkcN4oFBButJ+bAp3TPsUKV/eSm4IJijYzBhMA8GA1UdEwEB/wQF
MAMBAf8wHwYDVR0jBBgwFoAUpbtKl86zK3+kMd6Xg1mDpm9xy94wHQYDVR0OBBYEFKW7SpfOsyt/
pDHel4NZg6ZvccveMA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjBe8usGzEkxn0AA
bbd+NvBNEU/zy4k6LHiRUKNbwMp1JvK/kF0LgoxgKJ/GcJpo5PECMFxYDlZ2z1jD1xCMuo6u47xk
dUfFVZDj/bpV6wfEU6s3qe4hsiFbYI89MvHVI5TWWA==
-----END CERTIFICATE-----
CommScope Public Trust ECC Root-01
==================================
-----BEGIN CERTIFICATE-----
MIICHTCCAaOgAwIBAgIUQ3CCd89NXTTxyq4yLzf39H91oJ4wCgYIKoZIzj0EAwMwTjELMAkGA1UE
BhMCVVMxEjAQBgNVBAoMCUNvbW1TY29wZTErMCkGA1UEAwwiQ29tbVNjb3BlIFB1YmxpYyBUcnVz
dCBFQ0MgUm9vdC0wMTAeFw0yMTA0MjgxNzM1NDNaFw00NjA0MjgxNzM1NDJaME4xCzAJBgNVBAYT
AlVTMRIwEAYDVQQKDAlDb21tU2NvcGUxKzApBgNVBAMMIkNvbW1TY29wZSBQdWJsaWMgVHJ1c3Qg
RUNDIFJvb3QtMDEwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARLNumuV16ocNfQj3Rid8NeeqrltqLx
eP0CflfdkXmcbLlSiFS8LwS+uM32ENEp7LXQoMPwiXAZu1FlxUOcw5tjnSCDPgYLpkJEhRGnSjot
6dZoL0hOUysHP029uax3OVejQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G
A1UdDgQWBBSOB2LAUN3GGQYARnQE9/OufXVNMDAKBggqhkjOPQQDAwNoADBlAjEAnDPfQeMjqEI2
Jpc1XHvr20v4qotzVRVcrHgpD7oh2MSg2NED3W3ROT3Ek2DS43KyAjB8xX6I01D1HiXo+k515liW
pDVfG2XqYZpwI7UNo5uSUm9poIyNStDuiw7LR47QjRE=
-----END CERTIFICATE-----
CommScope Public Trust ECC Root-02
==================================
-----BEGIN CERTIFICATE-----
MIICHDCCAaOgAwIBAgIUKP2ZYEFHpgE6yhR7H+/5aAiDXX0wCgYIKoZIzj0EAwMwTjELMAkGA1UE
BhMCVVMxEjAQBgNVBAoMCUNvbW1TY29wZTErMCkGA1UEAwwiQ29tbVNjb3BlIFB1YmxpYyBUcnVz
dCBFQ0MgUm9vdC0wMjAeFw0yMTA0MjgxNzQ0NTRaFw00NjA0MjgxNzQ0NTNaME4xCzAJBgNVBAYT
AlVTMRIwEAYDVQQKDAlDb21tU2NvcGUxKzApBgNVBAMMIkNvbW1TY29wZSBQdWJsaWMgVHJ1c3Qg
RUNDIFJvb3QtMDIwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAR4MIHoYx7l63FRD/cHB8o5mXxO1Q/M
MDALj2aTPs+9xYa9+bG3tD60B8jzljHz7aRP+KNOjSkVWLjVb3/ubCK1sK9IRQq9qEmUv4RDsNuE
SgMjGWdqb8FuvAY5N9GIIvejQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G
A1UdDgQWBBTmGHX/72DehKT1RsfeSlXjMjZ59TAKBggqhkjOPQQDAwNnADBkAjAmc0l6tqvmSfR9
Uj/UQQSugEODZXW5hYA4O9Zv5JOGq4/nich/m35rChJVYaoR4HkCMHfoMXGsPHED1oQmHhS48zs7
3u1Z/GtMMH9ZzkXpc2AVmkzw5l4lIhVtwodZ0LKOag==
-----END CERTIFICATE-----
CommScope Public Trust RSA Root-01
==================================
-----BEGIN CERTIFICATE-----
MIIFbDCCA1SgAwIBAgIUPgNJgXUWdDGOTKvVxZAplsU5EN0wDQYJKoZIhvcNAQELBQAwTjELMAkG
A1UEBhMCVVMxEjAQBgNVBAoMCUNvbW1TY29wZTErMCkGA1UEAwwiQ29tbVNjb3BlIFB1YmxpYyBU
cnVzdCBSU0EgUm9vdC0wMTAeFw0yMTA0MjgxNjQ1NTRaFw00NjA0MjgxNjQ1NTNaME4xCzAJBgNV
BAYTAlVTMRIwEAYDVQQKDAlDb21tU2NvcGUxKzApBgNVBAMMIkNvbW1TY29wZSBQdWJsaWMgVHJ1
c3QgUlNBIFJvb3QtMDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwSGWjDR1C45Ft
nYSkYZYSwu3D2iM0GXb26v1VWvZVAVMP8syMl0+5UMuzAURWlv2bKOx7dAvnQmtVzslhsuitQDy6
uUEKBU8bJoWPQ7VAtYXR1HHcg0Hz9kXHgKKEUJdGzqAMxGBWBB0HW0alDrJLpA6lfO741GIDuZNq
ihS4cPgugkY4Iw50x2tBt9Apo52AsH53k2NC+zSDO3OjWiE260f6GBfZumbCk6SP/F2krfxQapWs
vCQz0b2If4b19bJzKo98rwjyGpg/qYFlP8GMicWWMJoKz/TUyDTtnS+8jTiGU+6Xn6myY5QXjQ/c
Zip8UlF1y5mO6D1cv547KI2DAg+pn3LiLCuz3GaXAEDQpFSOm117RTYm1nJD68/A6g3czhLmfTif
BSeolz7pUcZsBSjBAg/pGG3svZwG1KdJ9FQFa2ww8esD1eo9anbCyxooSU1/ZOD6K9pzg4H/kQO9
lLvkuI6cMmPNn7togbGEW682v3fuHX/3SZtS7NJ3Wn2RnU3COS3kuoL4b/JOHg9O5j9ZpSPcPYeo
KFgo0fEbNttPxP/hjFtyjMcmAyejOQoBqsCyMWCDIqFPEgkBEa801M/XrmLTBQe0MXXgDW1XT2mH
+VepuhX2yFJtocucH+X8eKg1mp9BFM6ltM6UCBwJrVbl2rZJmkrqYxhTnCwuwwIDAQABo0IwQDAP
BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUN12mmnQywsL5x6YVEFm4
5P3luG0wDQYJKoZIhvcNAQELBQADggIBAK+nz97/4L1CjU3lIpbfaOp9TSp90K09FlxD533Ahuh6
NWPxzIHIxgvoLlI1pKZJkGNRrDSsBTtXAOnTYtPZKdVUvhwQkZyybf5Z/Xn36lbQnmhUQo8mUuJM
3y+Xpi/SB5io82BdS5pYV4jvguX6r2yBS5KPQJqTRlnLX3gWsWc+QgvfKNmwrZggvkN80V4aCRck
jXtdlemrwWCrWxhkgPut4AZ9HcpZuPN4KWfGVh2vtrV0KnahP/t1MJ+UXjulYPPLXAziDslg+Mkf
Foom3ecnf+slpoq9uC02EJqxWE2aaE9gVOX2RhOOiKy8IUISrcZKiX2bwdgt6ZYD9KJ0DLwAHb/W
NyVntHKLr4W96ioDj8z7PEQkguIBpQtZtjSNMgsSDesnwv1B10A8ckYpwIzqug/xBpMu95yo9GA+
o/E4Xo4TwbM6l4c/ksp4qRyv0LAbJh6+cOx69TOY6lz/KwsETkPdY34Op054A5U+1C0wlREQKC6/
oAI+/15Z0wUOlV9TRe9rh9VIzRamloPh37MG88EU26fsHItdkJANclHnYfkUyq+Dj7+vsQpZXdxc
1+SWrVtgHdqul7I52Qb1dgAT+GhMIbA1xNxVssnBQVocicCMb3SgazNNtQEo/a2tiRc7ppqEvOuM
6sRxJKi6KfkIsidWNTJf6jn7MZrVGczw
-----END CERTIFICATE-----
CommScope Public Trust RSA Root-02
==================================
-----BEGIN CERTIFICATE-----
MIIFbDCCA1SgAwIBAgIUVBa/O345lXGN0aoApYYNK496BU4wDQYJKoZIhvcNAQELBQAwTjELMAkG
A1UEBhMCVVMxEjAQBgNVBAoMCUNvbW1TY29wZTErMCkGA1UEAwwiQ29tbVNjb3BlIFB1YmxpYyBU
cnVzdCBSU0EgUm9vdC0wMjAeFw0yMTA0MjgxNzE2NDNaFw00NjA0MjgxNzE2NDJaME4xCzAJBgNV
BAYTAlVTMRIwEAYDVQQKDAlDb21tU2NvcGUxKzApBgNVBAMMIkNvbW1TY29wZSBQdWJsaWMgVHJ1
c3QgUlNBIFJvb3QtMDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDh+g77aAASyE3V
rCLENQE7xVTlWXZjpX/rwcRqmL0yjReA61260WI9JSMZNRTpf4mnG2I81lDnNJUDMrG0kyI9p+Kx
7eZ7Ti6Hmw0zdQreqjXnfuU2mKKuJZ6VszKWpCtYHu8//mI0SFHRtI1CrWDaSWqVcN3SAOLMV2MC
e5bdSZdbkk6V0/nLKR8YSvgBKtJjCW4k6YnS5cciTNxzhkcAqg2Ijq6FfUrpuzNPDlJwnZXjfG2W
Wy09X6GDRl224yW4fKcZgBzqZUPckXk2LHR88mcGyYnJ27/aaL8j7dxrrSiDeS/sOKUNNwFnJ5rp
M9kzXzehxfCrPfp4sOcsn/Y+n2Dg70jpkEUeBVF4GiwSLFworA2iI540jwXmojPOEXcT1A6kHkIf
hs1w/tkuFT0du7jyU1fbzMZ0KZwYszZ1OC4PVKH4kh+Jlk+71O6d6Ts2QrUKOyrUZHk2EOH5kQMr
eyBUzQ0ZGshBMjTRsJnhkB4BQDa1t/qp5Xd1pCKBXbCL5CcSD1SIxtuFdOa3wNemKfrb3vOTlycE
VS8KbzfFPROvCgCpLIscgSjX74Yxqa7ybrjKaixUR9gqiC6vwQcQeKwRoi9C8DfF8rhW3Q5iLc4t
Vn5V8qdE9isy9COoR+jUKgF4z2rDN6ieZdIs5fq6M8EGRPbmz6UNp2YINIos8wIDAQABo0IwQDAP
BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUR9DnsSL/nSz12Vdgs7Gx
cJXvYXowDQYJKoZIhvcNAQELBQADggIBAIZpsU0v6Z9PIpNojuQhmaPORVMbc0RTAIFhzTHjCLqB
KCh6krm2qMhDnscTJk3C2OVVnJJdUNjCK9v+5qiXz1I6JMNlZFxHMaNlNRPDk7n3+VGXu6TwYofF
1gbTl4MgqX67tiHCpQ2EAOHyJxCDut0DgdXdaMNmEMjRdrSzbymeAPnCKfWxkxlSaRosTKCL4BWa
MS/TiJVZbuXEs1DIFAhKm4sTg7GkcrI7djNB3NyqpgdvHSQSn8h2vS/ZjvQs7rfSOBAkNlEv41xd
gSGn2rtO/+YHqP65DSdsu3BaVXoT6fEqSWnHX4dXTEN5bTpl6TBcQe7rd6VzEojov32u5cSoHw2O
HG1QAk8mGEPej1WFsQs3BWDJVTkSBKEqz3EWnzZRSb9wO55nnPt7eck5HHisd5FUmrh1CoFSl+Nm
YWvtPjgelmFV4ZFUjO2MJB+ByRCac5krFk5yAD9UG/iNuovnFNa2RU9g7Jauwy8CTl2dlklyALKr
dVwPaFsdZcJfMw8eD/A7hvWwTruc9+olBdytoptLFwG+Qt81IR2tq670v64fG9PiO/yzcnMcmyiQ
iRM9HcEARwmWmjgb3bHPDcK0RPOWlc4yOo80nOAXx17Org3bhzjlP1v9mxnhMUF6cKojawHhRUzN
lM47ni3niAIi9G7oyOzWPPO5std3eqx7
-----END CERTIFICATE-----

View File

@ -8,7 +8,7 @@
#ifndef CPPHTTPLIB_HTTPLIB_H #ifndef CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_HTTPLIB_H #define CPPHTTPLIB_HTTPLIB_H
#define CPPHTTPLIB_VERSION "0.14.0" #define CPPHTTPLIB_VERSION "0.14.2"
/* /*
* Configuration * Configuration
@ -247,7 +247,6 @@ using socket_t = int;
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment(lib, "crypt32.lib") #pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "cryptui.lib")
#endif #endif
#elif defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN) && defined(__APPLE__) #elif defined(CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN) && defined(__APPLE__)
#include <TargetConditionals.h> #include <TargetConditionals.h>
@ -331,7 +330,7 @@ struct scope_exit {
explicit scope_exit(std::function<void(void)> &&f) explicit scope_exit(std::function<void(void)> &&f)
: exit_function(std::move(f)), execute_on_destruction{true} {} : exit_function(std::move(f)), execute_on_destruction{true} {}
scope_exit(scope_exit &&rhs) scope_exit(scope_exit &&rhs) noexcept
: exit_function(std::move(rhs.exit_function)), : exit_function(std::move(rhs.exit_function)),
execute_on_destruction{rhs.execute_on_destruction} { execute_on_destruction{rhs.execute_on_destruction} {
rhs.release(); rhs.release();
@ -385,6 +384,7 @@ public:
DataSink &operator=(DataSink &&) = delete; DataSink &operator=(DataSink &&) = delete;
std::function<bool(const char *data, size_t data_len)> write; std::function<bool(const char *data, size_t data_len)> write;
std::function<bool()> is_writable;
std::function<void()> done; std::function<void()> done;
std::function<void(const Headers &trailer)> done_with_trailer; std::function<void(const Headers &trailer)> done_with_trailer;
std::ostream os; std::ostream os;
@ -395,7 +395,7 @@ private:
explicit data_sink_streambuf(DataSink &sink) : sink_(sink) {} explicit data_sink_streambuf(DataSink &sink) : sink_(sink) {}
protected: protected:
std::streamsize xsputn(const char *s, std::streamsize n) { std::streamsize xsputn(const char *s, std::streamsize n) override {
sink_.write(s, static_cast<size_t>(n)); sink_.write(s, static_cast<size_t>(n));
return n; return n;
} }
@ -873,15 +873,15 @@ private:
bool routing(Request &req, Response &res, Stream &strm); bool routing(Request &req, Response &res, Stream &strm);
bool handle_file_request(const Request &req, Response &res, bool handle_file_request(const Request &req, Response &res,
bool head = false); bool head = false);
bool dispatch_request(Request &req, Response &res, const Handlers &handlers); bool dispatch_request(Request &req, Response &res,
bool const Handlers &handlers) const;
dispatch_request_for_content_reader(Request &req, Response &res, bool dispatch_request_for_content_reader(
ContentReader content_reader, Request &req, Response &res, ContentReader content_reader,
const HandlersForContentReader &handlers); const HandlersForContentReader &handlers) const;
bool parse_request_line(const char *s, Request &req); bool parse_request_line(const char *s, Request &req) const;
void apply_ranges(const Request &req, Response &res, void apply_ranges(const Request &req, Response &res,
std::string &content_type, std::string &boundary); std::string &content_type, std::string &boundary) const;
bool write_response(Stream &strm, bool close_connection, const Request &req, bool write_response(Stream &strm, bool close_connection, const Request &req,
Response &res); Response &res);
bool write_response_with_content(Stream &strm, bool close_connection, bool write_response_with_content(Stream &strm, bool close_connection,
@ -901,7 +901,7 @@ private:
bool read_content_core(Stream &strm, Request &req, Response &res, bool read_content_core(Stream &strm, Request &req, Response &res,
ContentReceiver receiver, ContentReceiver receiver,
MultipartContentHeader multipart_header, MultipartContentHeader multipart_header,
ContentReceiver multipart_receiver); ContentReceiver multipart_receiver) const;
virtual bool process_and_close_socket(socket_t sock); virtual bool process_and_close_socket(socket_t sock);
@ -967,7 +967,7 @@ enum class Error {
SSLPeerCouldBeClosed_, SSLPeerCouldBeClosed_,
}; };
std::string to_string(const Error error); std::string to_string(Error error);
std::ostream &operator<<(std::ostream &os, const Error &obj); std::ostream &operator<<(std::ostream &os, const Error &obj);
@ -1226,7 +1226,7 @@ public:
void set_ca_cert_path(const std::string &ca_cert_file_path, void set_ca_cert_path(const std::string &ca_cert_file_path,
const std::string &ca_cert_dir_path = std::string()); const std::string &ca_cert_dir_path = std::string());
void set_ca_cert_store(X509_STORE *ca_cert_store); void set_ca_cert_store(X509_STORE *ca_cert_store);
X509_STORE *create_ca_cert_store(const char *ca_cert, std::size_t size); X509_STORE *create_ca_cert_store(const char *ca_cert, std::size_t size) const;
#endif #endif
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT #ifdef CPPHTTPLIB_OPENSSL_SUPPORT
@ -1255,14 +1255,14 @@ protected:
// Also, shutdown_ssl and close_socket should also NOT be called concurrently // Also, shutdown_ssl and close_socket should also NOT be called concurrently
// with a DIFFERENT thread sending requests using that socket. // with a DIFFERENT thread sending requests using that socket.
virtual void shutdown_ssl(Socket &socket, bool shutdown_gracefully); virtual void shutdown_ssl(Socket &socket, bool shutdown_gracefully);
void shutdown_socket(Socket &socket); void shutdown_socket(Socket &socket) const;
void close_socket(Socket &socket); void close_socket(Socket &socket);
bool process_request(Stream &strm, Request &req, Response &res, bool process_request(Stream &strm, Request &req, Response &res,
bool close_connection, Error &error); bool close_connection, Error &error);
bool write_content_with_provider(Stream &strm, const Request &req, bool write_content_with_provider(Stream &strm, const Request &req,
Error &error); Error &error) const;
void copy_settings(const ClientImpl &rhs); void copy_settings(const ClientImpl &rhs);
@ -1353,7 +1353,8 @@ private:
Result send_(Request &&req); Result send_(Request &&req);
socket_t create_client_socket(Error &error) const; socket_t create_client_socket(Error &error) const;
bool read_response_line(Stream &strm, const Request &req, Response &res); bool read_response_line(Stream &strm, const Request &req,
Response &res) const;
bool write_request(Stream &strm, Request &req, bool close_connection, bool write_request(Stream &strm, Request &req, bool close_connection,
Error &error); Error &error);
bool redirect(Request &req, Response &res, Error &error); bool redirect(Request &req, Response &res, Error &error);
@ -1372,7 +1373,7 @@ private:
const std::string &content_type); const std::string &content_type);
ContentProviderWithoutLength get_multipart_content_provider( ContentProviderWithoutLength get_multipart_content_provider(
const std::string &boundary, const MultipartFormDataItems &items, const std::string &boundary, const MultipartFormDataItems &items,
const MultipartFormDataProviderItems &provider_items); const MultipartFormDataProviderItems &provider_items) const;
std::string adjust_host_string(const std::string &host) const; std::string adjust_host_string(const std::string &host) const;
@ -1685,7 +1686,7 @@ public:
private: private:
bool create_and_connect_socket(Socket &socket, Error &error) override; bool create_and_connect_socket(Socket &socket, Error &error) override;
void shutdown_ssl(Socket &socket, bool shutdown_gracefully) override; void shutdown_ssl(Socket &socket, bool shutdown_gracefully) override;
void shutdown_ssl_impl(Socket &socket, bool shutdown_socket); void shutdown_ssl_impl(Socket &socket, bool shutdown_gracefully);
bool process_socket(const Socket &socket, bool process_socket(const Socket &socket,
std::function<bool(Stream &strm)> callback) override; std::function<bool(Stream &strm)> callback) override;
@ -2075,6 +2076,9 @@ std::string trim_copy(const std::string &s);
void split(const char *b, const char *e, char d, void split(const char *b, const char *e, char d,
std::function<void(const char *, const char *)> fn); std::function<void(const char *, const char *)> fn);
void split(const char *b, const char *e, char d, size_t m,
std::function<void(const char *, const char *)> fn);
bool process_client_socket(socket_t sock, time_t read_timeout_sec, bool process_client_socket(socket_t sock, time_t read_timeout_sec,
time_t read_timeout_usec, time_t write_timeout_sec, time_t read_timeout_usec, time_t write_timeout_sec,
time_t write_timeout_usec, time_t write_timeout_usec,
@ -2151,7 +2155,7 @@ public:
class nocompressor : public compressor { class nocompressor : public compressor {
public: public:
virtual ~nocompressor() = default; ~nocompressor() override = default;
bool compress(const char *data, size_t data_length, bool /*last*/, bool compress(const char *data, size_t data_length, bool /*last*/,
Callback callback) override; Callback callback) override;
@ -2161,7 +2165,7 @@ public:
class gzip_compressor : public compressor { class gzip_compressor : public compressor {
public: public:
gzip_compressor(); gzip_compressor();
~gzip_compressor(); ~gzip_compressor() override;
bool compress(const char *data, size_t data_length, bool last, bool compress(const char *data, size_t data_length, bool last,
Callback callback) override; Callback callback) override;
@ -2174,7 +2178,7 @@ private:
class gzip_decompressor : public decompressor { class gzip_decompressor : public decompressor {
public: public:
gzip_decompressor(); gzip_decompressor();
~gzip_decompressor(); ~gzip_decompressor() override;
bool is_valid() const override; bool is_valid() const override;
@ -2317,7 +2321,7 @@ inline std::string from_i_to_hex(size_t n) {
inline size_t to_utf8(int code, char *buff) { inline size_t to_utf8(int code, char *buff) {
if (code < 0x0080) { if (code < 0x0080) {
buff[0] = (code & 0x7F); buff[0] = static_cast<char>(code & 0x7F);
return 1; return 1;
} else if (code < 0x0800) { } else if (code < 0x0800) {
buff[0] = static_cast<char>(0xC0 | ((code >> 6) & 0x1F)); buff[0] = static_cast<char>(0xC0 | ((code >> 6) & 0x1F));
@ -2583,16 +2587,23 @@ inline std::string trim_double_quotes_copy(const std::string &s) {
inline void split(const char *b, const char *e, char d, inline void split(const char *b, const char *e, char d,
std::function<void(const char *, const char *)> fn) { std::function<void(const char *, const char *)> fn) {
return split(b, e, d, std::numeric_limits<size_t>::max(), fn);
}
inline void split(const char *b, const char *e, char d, size_t m,
std::function<void(const char *, const char *)> fn) {
size_t i = 0; size_t i = 0;
size_t beg = 0; size_t beg = 0;
size_t count = 1;
while (e ? (b + i < e) : (b[i] != '\0')) { while (e ? (b + i < e) : (b[i] != '\0')) {
if (b[i] == d) { if (b[i] == d && count < m) {
auto r = trim(b, e, beg, i); auto r = trim(b, e, beg, i);
if (r.first < r.second) { if (r.first < r.second) {
fn(&b[r.first], &b[r.second]); fn(&b[r.first], &b[r.second]);
} }
beg = i + 1; beg = i + 1;
count++;
} }
i++; i++;
} }
@ -2683,9 +2694,7 @@ inline mmap::mmap(const char *path)
, ,
size_(0), size_(0),
addr_(nullptr) { addr_(nullptr) {
if (!open(path)) { open(path);
std::runtime_error("");
}
} }
inline mmap::~mmap() { close(); } inline mmap::~mmap() { close(); }
@ -2974,7 +2983,7 @@ private:
size_t read_buff_off_ = 0; size_t read_buff_off_ = 0;
size_t read_buff_content_size_ = 0; size_t read_buff_content_size_ = 0;
static const size_t read_buff_size_ = 1024 * 4; static const size_t read_buff_size_ = 1024l * 4;
}; };
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT #ifdef CPPHTTPLIB_OPENSSL_SUPPORT
@ -3109,8 +3118,9 @@ socket_t create_socket(const std::string &host, const std::string &ip, int port,
#ifndef _WIN32 #ifndef _WIN32
if (hints.ai_family == AF_UNIX) { if (hints.ai_family == AF_UNIX) {
const auto addrlen = host.length(); const auto addrlen = host.length();
if (addrlen > sizeof(sockaddr_un::sun_path)) if (addrlen > sizeof(sockaddr_un::sun_path)) {
return INVALID_SOCKET; return INVALID_SOCKET;
}
auto sock = socket(hints.ai_family, hints.ai_socktype, hints.ai_protocol); auto sock = socket(hints.ai_family, hints.ai_socktype, hints.ai_protocol);
if (sock != INVALID_SOCKET) { if (sock != INVALID_SOCKET) {
@ -3324,7 +3334,7 @@ inline socket_t create_client_socket(
if (ip_from_if.empty()) { if (ip_from_if.empty()) {
ip_from_if = intf; ip_from_if = intf;
} }
if (!bind_ip_address(sock2, ip_from_if.c_str())) { if (!bind_ip_address(sock2, ip_from_if)) {
error = Error::BindIPAddress; error = Error::BindIPAddress;
return false; return false;
} }
@ -3486,7 +3496,7 @@ find_content_type(const std::string &path,
auto it = user_data.find(ext); auto it = user_data.find(ext);
if (it != user_data.end()) { if (it != user_data.end()) {
return it->second.c_str(); return it->second;
} }
using udl::operator""_t; using udl::operator""_t;
@ -3752,8 +3762,9 @@ inline bool gzip_decompressor::decompress(const char *data, size_t data_length,
} }
} }
if (ret != Z_OK && ret != Z_STREAM_END) if (ret != Z_OK && ret != Z_STREAM_END) {
return false; return false;
}
} while (data_length > 0); } while (data_length > 0);
@ -4069,7 +4080,7 @@ inline bool read_content_chunked(Stream &strm, T &x,
return false; return false;
} }
if (strcmp(line_reader.ptr(), "\r\n")) { if (strcmp(line_reader.ptr(), "\r\n") != 0) {
return false; return false;
} }
@ -4085,7 +4096,7 @@ inline bool read_content_chunked(Stream &strm, T &x,
return false; return false;
} }
while (strcmp(line_reader.ptr(), "\r\n")) { while (strcmp(line_reader.ptr(), "\r\n") != 0) {
if (line_reader.size() > CPPHTTPLIB_HEADER_MAX_LENGTH) { if (line_reader.size() > CPPHTTPLIB_HEADER_MAX_LENGTH) {
return false; return false;
} }
@ -4241,6 +4252,8 @@ inline bool write_content(Stream &strm, const ContentProvider &content_provider,
return ok; return ok;
}; };
data_sink.is_writable = [&]() -> bool { return strm.is_writable(); };
while (offset < end_offset && !is_shutting_down()) { while (offset < end_offset && !is_shutting_down()) {
if (!strm.is_writable()) { if (!strm.is_writable()) {
error = Error::Write; error = Error::Write;
@ -4287,6 +4300,8 @@ write_content_without_length(Stream &strm,
return ok; return ok;
}; };
data_sink.is_writable = [&]() -> bool { return strm.is_writable(); };
data_sink.done = [&](void) { data_available = false; }; data_sink.done = [&](void) { data_available = false; };
while (data_available && !is_shutting_down()) { while (data_available && !is_shutting_down()) {
@ -4337,6 +4352,8 @@ write_content_chunked(Stream &strm, const ContentProvider &content_provider,
return ok; return ok;
}; };
data_sink.is_writable = [&]() -> bool { return strm.is_writable(); };
auto done_with_trailer = [&](const Headers *trailer) { auto done_with_trailer = [&](const Headers *trailer) {
if (!ok) { if (!ok) {
return; return;
@ -4438,9 +4455,10 @@ inline bool redirect(T &cli, Request &req, Response &res,
req = new_req; req = new_req;
res = new_res; res = new_res;
if (res.location.empty()) if (res.location.empty()) {
res.location = location; res.location = location;
} }
}
return ret; return ret;
} }
@ -4534,8 +4552,9 @@ inline bool parse_range_header(const std::string &s, Ranges &ranges) try {
auto len = static_cast<size_t>(m.length(1)); auto len = static_cast<size_t>(m.length(1));
auto all_valid_ranges = true; auto all_valid_ranges = true;
split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) { split(&s[pos], &s[pos + len], ',', [&](const char *b, const char *e) {
if (!all_valid_ranges) if (!all_valid_ranges) {
return; return;
}
static auto re_another_range = std::regex(R"(\s*(\d*)-(\d*))"); static auto re_another_range = std::regex(R"(\s*(\d*)-(\d*))");
std::cmatch cm; std::cmatch cm;
if (std::regex_match(b, e, cm, re_another_range)) { if (std::regex_match(b, e, cm, re_another_range)) {
@ -4922,8 +4941,9 @@ serialize_multipart_formdata(const MultipartFormDataItems &items,
body += item.content + serialize_multipart_formdata_item_end(); body += item.content + serialize_multipart_formdata_item_end();
} }
if (finish) if (finish) {
body += serialize_multipart_formdata_finish(boundary); body += serialize_multipart_formdata_finish(boundary);
}
return body; return body;
} }
@ -5376,7 +5396,7 @@ inline std::string random_string(size_t length) {
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"; "abcdefghijklmnopqrstuvwxyz";
const size_t max_index = (sizeof(charset) - 1); const size_t max_index = (sizeof(charset) - 1);
return charset[repertory_rand<size_t>() % max_index]; return charset[repertory_rand<std::size_t>() % max_index];
}; };
std::string str(length, 0); std::string str(length, 0);
std::generate_n(str.begin(), length, randchar); std::generate_n(str.begin(), length, randchar);
@ -5671,7 +5691,7 @@ inline SocketStream::SocketStream(socket_t sock, time_t read_timeout_sec,
write_timeout_usec_(write_timeout_usec), write_timeout_usec_(write_timeout_usec),
read_buff_(read_buff_size_, 0) {} read_buff_(read_buff_size_, 0) {}
inline SocketStream::~SocketStream() {} inline SocketStream::~SocketStream() = default;
inline bool SocketStream::is_readable() const { inline bool SocketStream::is_readable() const {
return select_read(sock_, read_timeout_sec_, read_timeout_usec_) > 0; return select_read(sock_, read_timeout_sec_, read_timeout_usec_) > 0;
@ -5897,7 +5917,7 @@ inline Server::Server()
#endif #endif
} }
inline Server::~Server() {} inline Server::~Server() = default;
inline std::unique_ptr<detail::MatcherBase> inline std::unique_ptr<detail::MatcherBase>
Server::make_matcher(const std::string &pattern) { Server::make_matcher(const std::string &pattern) {
@ -5909,66 +5929,60 @@ Server::make_matcher(const std::string &pattern) {
} }
inline Server &Server::Get(const std::string &pattern, Handler handler) { inline Server &Server::Get(const std::string &pattern, Handler handler) {
get_handlers_.push_back( get_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
std::make_pair(make_matcher(pattern), std::move(handler)));
return *this; return *this;
} }
inline Server &Server::Post(const std::string &pattern, Handler handler) { inline Server &Server::Post(const std::string &pattern, Handler handler) {
post_handlers_.push_back( post_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
std::make_pair(make_matcher(pattern), std::move(handler)));
return *this; return *this;
} }
inline Server &Server::Post(const std::string &pattern, inline Server &Server::Post(const std::string &pattern,
HandlerWithContentReader handler) { HandlerWithContentReader handler) {
post_handlers_for_content_reader_.push_back( post_handlers_for_content_reader_.emplace_back(make_matcher(pattern),
std::make_pair(make_matcher(pattern), std::move(handler))); std::move(handler));
return *this; return *this;
} }
inline Server &Server::Put(const std::string &pattern, Handler handler) { inline Server &Server::Put(const std::string &pattern, Handler handler) {
put_handlers_.push_back( put_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
std::make_pair(make_matcher(pattern), std::move(handler)));
return *this; return *this;
} }
inline Server &Server::Put(const std::string &pattern, inline Server &Server::Put(const std::string &pattern,
HandlerWithContentReader handler) { HandlerWithContentReader handler) {
put_handlers_for_content_reader_.push_back( put_handlers_for_content_reader_.emplace_back(make_matcher(pattern),
std::make_pair(make_matcher(pattern), std::move(handler))); std::move(handler));
return *this; return *this;
} }
inline Server &Server::Patch(const std::string &pattern, Handler handler) { inline Server &Server::Patch(const std::string &pattern, Handler handler) {
patch_handlers_.push_back( patch_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
std::make_pair(make_matcher(pattern), std::move(handler)));
return *this; return *this;
} }
inline Server &Server::Patch(const std::string &pattern, inline Server &Server::Patch(const std::string &pattern,
HandlerWithContentReader handler) { HandlerWithContentReader handler) {
patch_handlers_for_content_reader_.push_back( patch_handlers_for_content_reader_.emplace_back(make_matcher(pattern),
std::make_pair(make_matcher(pattern), std::move(handler))); std::move(handler));
return *this; return *this;
} }
inline Server &Server::Delete(const std::string &pattern, Handler handler) { inline Server &Server::Delete(const std::string &pattern, Handler handler) {
delete_handlers_.push_back( delete_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
std::make_pair(make_matcher(pattern), std::move(handler)));
return *this; return *this;
} }
inline Server &Server::Delete(const std::string &pattern, inline Server &Server::Delete(const std::string &pattern,
HandlerWithContentReader handler) { HandlerWithContentReader handler) {
delete_handlers_for_content_reader_.push_back( delete_handlers_for_content_reader_.emplace_back(make_matcher(pattern),
std::make_pair(make_matcher(pattern), std::move(handler))); std::move(handler));
return *this; return *this;
} }
inline Server &Server::Options(const std::string &pattern, Handler handler) { inline Server &Server::Options(const std::string &pattern, Handler handler) {
options_handlers_.push_back( options_handlers_.emplace_back(make_matcher(pattern), std::move(handler));
std::make_pair(make_matcher(pattern), std::move(handler)));
return *this; return *this;
} }
@ -6116,9 +6130,7 @@ inline Server &Server::set_payload_max_length(size_t length) {
inline bool Server::bind_to_port(const std::string &host, int port, inline bool Server::bind_to_port(const std::string &host, int port,
int socket_flags) { int socket_flags) {
if (bind_internal(host, port, socket_flags) < 0) return bind_internal(host, port, socket_flags) >= 0;
return false;
return true;
} }
inline int Server::bind_to_any_port(const std::string &host, int socket_flags) { inline int Server::bind_to_any_port(const std::string &host, int socket_flags) {
return bind_internal(host, 0, socket_flags); return bind_internal(host, 0, socket_flags);
@ -6152,7 +6164,7 @@ inline void Server::stop() {
} }
} }
inline bool Server::parse_request_line(const char *s, Request &req) { inline bool Server::parse_request_line(const char *s, Request &req) const {
auto len = strlen(s); auto len = strlen(s);
if (len < 2 || s[len - 2] != '\r' || s[len - 1] != '\n') { if (len < 2 || s[len - 2] != '\r' || s[len - 1] != '\n') {
return false; return false;
@ -6208,7 +6220,7 @@ inline bool Server::parse_request_line(const char *s, Request &req) {
size_t count = 0; size_t count = 0;
detail::split(req.target.data(), req.target.data() + req.target.size(), '?', detail::split(req.target.data(), req.target.data() + req.target.size(), '?',
[&](const char *b, const char *e) { 2, [&](const char *b, const char *e) {
switch (count) { switch (count) {
case 0: case 0:
req.path = detail::decode_url(std::string(b, e), false); req.path = detail::decode_url(std::string(b, e), false);
@ -6433,10 +6445,11 @@ inline bool Server::read_content_with_content_receiver(
std::move(multipart_receiver)); std::move(multipart_receiver));
} }
inline bool Server::read_content_core(Stream &strm, Request &req, Response &res, inline bool
Server::read_content_core(Stream &strm, Request &req, Response &res,
ContentReceiver receiver, ContentReceiver receiver,
MultipartContentHeader multipart_header, MultipartContentHeader multipart_header,
ContentReceiver multipart_receiver) { ContentReceiver multipart_receiver) const {
detail::MultipartFormDataParser multipart_form_data_parser; detail::MultipartFormDataParser multipart_form_data_parser;
ContentReceiverWithProgress out; ContentReceiverWithProgress out;
@ -6502,7 +6515,7 @@ inline bool Server::handle_file_request(const Request &req, Response &res,
if (detail::is_file(path)) { if (detail::is_file(path)) {
for (const auto &kv : entry.headers) { for (const auto &kv : entry.headers) {
res.set_header(kv.first.c_str(), kv.second); res.set_header(kv.first, kv.second);
} }
auto mm = std::make_shared<detail::mmap>(path.c_str()); auto mm = std::make_shared<detail::mmap>(path.c_str());
@ -6739,7 +6752,7 @@ inline bool Server::routing(Request &req, Response &res, Stream &strm) {
} }
inline bool Server::dispatch_request(Request &req, Response &res, inline bool Server::dispatch_request(Request &req, Response &res,
const Handlers &handlers) { const Handlers &handlers) const {
for (const auto &x : handlers) { for (const auto &x : handlers) {
const auto &matcher = x.first; const auto &matcher = x.first;
const auto &handler = x.second; const auto &handler = x.second;
@ -6754,7 +6767,7 @@ inline bool Server::dispatch_request(Request &req, Response &res,
inline void Server::apply_ranges(const Request &req, Response &res, inline void Server::apply_ranges(const Request &req, Response &res,
std::string &content_type, std::string &content_type,
std::string &boundary) { std::string &boundary) const {
if (req.ranges.size() > 1) { if (req.ranges.size() > 1) {
boundary = detail::make_multipart_data_boundary(); boundary = detail::make_multipart_data_boundary();
@ -6866,7 +6879,7 @@ inline void Server::apply_ranges(const Request &req, Response &res,
inline bool Server::dispatch_request_for_content_reader( inline bool Server::dispatch_request_for_content_reader(
Request &req, Response &res, ContentReader content_reader, Request &req, Response &res, ContentReader content_reader,
const HandlersForContentReader &handlers) { const HandlersForContentReader &handlers) const {
for (const auto &x : handlers) { for (const auto &x : handlers) {
const auto &matcher = x.first; const auto &matcher = x.first;
const auto &handler = x.second; const auto &handler = x.second;
@ -7125,8 +7138,9 @@ inline socket_t ClientImpl::create_client_socket(Error &error) const {
// Check is custom IP specified for host_ // Check is custom IP specified for host_
std::string ip; std::string ip;
auto it = addr_map_.find(host_); auto it = addr_map_.find(host_);
if (it != addr_map_.end()) if (it != addr_map_.end()) {
ip = it->second; ip = it->second;
}
return detail::create_client_socket( return detail::create_client_socket(
host_, ip, port_, address_family_, tcp_nodelay_, socket_options_, host_, ip, port_, address_family_, tcp_nodelay_, socket_options_,
@ -7153,7 +7167,7 @@ inline void ClientImpl::shutdown_ssl(Socket & /*socket*/,
socket_requests_are_from_thread_ == std::this_thread::get_id()); socket_requests_are_from_thread_ == std::this_thread::get_id());
} }
inline void ClientImpl::shutdown_socket(Socket &socket) { inline void ClientImpl::shutdown_socket(Socket &socket) const {
if (socket.sock == INVALID_SOCKET) { if (socket.sock == INVALID_SOCKET) {
return; return;
} }
@ -7182,7 +7196,7 @@ inline void ClientImpl::close_socket(Socket &socket) {
} }
inline bool ClientImpl::read_response_line(Stream &strm, const Request &req, inline bool ClientImpl::read_response_line(Stream &strm, const Request &req,
Response &res) { Response &res) const {
std::array<char, 2048> buf{}; std::array<char, 2048> buf{};
detail::stream_line_reader line_reader(strm, buf.data(), buf.size()); detail::stream_line_reader line_reader(strm, buf.data(), buf.size());
@ -7476,7 +7490,7 @@ inline bool ClientImpl::redirect(Request &req, Response &res, Error &error) {
} else { } else {
if (next_scheme == "https") { if (next_scheme == "https") {
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT #ifdef CPPHTTPLIB_OPENSSL_SUPPORT
SSLClient cli(next_host.c_str(), next_port); SSLClient cli(next_host, next_port);
cli.copy_settings(*this); cli.copy_settings(*this);
if (ca_cert_store_) { if (ca_cert_store_) {
cli.set_ca_cert_store(ca_cert_store_); cli.set_ca_cert_store(ca_cert_store_);
@ -7486,7 +7500,7 @@ inline bool ClientImpl::redirect(Request &req, Response &res, Error &error) {
return false; return false;
#endif #endif
} else { } else {
ClientImpl cli(next_host.c_str(), next_port); ClientImpl cli(next_host, next_port);
cli.copy_settings(*this); cli.copy_settings(*this);
return detail::redirect(cli, req, res, path, location, error); return detail::redirect(cli, req, res, path, location, error);
} }
@ -7495,7 +7509,7 @@ inline bool ClientImpl::redirect(Request &req, Response &res, Error &error) {
inline bool ClientImpl::write_content_with_provider(Stream &strm, inline bool ClientImpl::write_content_with_provider(Stream &strm,
const Request &req, const Request &req,
Error &error) { Error &error) const {
auto is_shutting_down = []() { return false; }; auto is_shutting_down = []() { return false; };
if (req.is_chunked_content_provider_) { if (req.is_chunked_content_provider_) {
@ -7843,13 +7857,14 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
inline ContentProviderWithoutLength ClientImpl::get_multipart_content_provider( inline ContentProviderWithoutLength ClientImpl::get_multipart_content_provider(
const std::string &boundary, const MultipartFormDataItems &items, const std::string &boundary, const MultipartFormDataItems &items,
const MultipartFormDataProviderItems &provider_items) { const MultipartFormDataProviderItems &provider_items) const {
size_t cur_item = 0, cur_start = 0; size_t cur_item = 0;
size_t cur_start = 0;
// cur_item and cur_start are copied to within the std::function and maintain // cur_item and cur_start are copied to within the std::function and maintain
// state between successive calls // state between successive calls
return [&, cur_item, cur_start](size_t offset, return [&, cur_item, cur_start](size_t offset,
DataSink &sink) mutable -> bool { DataSink &sink) mutable -> bool {
if (!offset && items.size()) { if (!offset && !items.empty()) {
sink.os << detail::serialize_multipart_formdata(items, boundary, false); sink.os << detail::serialize_multipart_formdata(items, boundary, false);
return true; return true;
} else if (cur_item < provider_items.size()) { } else if (cur_item < provider_items.size()) {
@ -7866,8 +7881,9 @@ inline ContentProviderWithoutLength ClientImpl::get_multipart_content_provider(
cur_sink.write = sink.write; cur_sink.write = sink.write;
cur_sink.done = [&]() { has_data = false; }; cur_sink.done = [&]() { has_data = false; };
if (!provider_items[cur_item].provider(offset - cur_start, cur_sink)) if (!provider_items[cur_item].provider(offset - cur_start, cur_sink)) {
return false; return false;
}
if (!has_data) { if (!has_data) {
sink.os << detail::serialize_multipart_formdata_item_end(); sink.os << detail::serialize_multipart_formdata_item_end();
@ -7988,7 +8004,7 @@ inline Result ClientImpl::Get(const std::string &path, const Params &params,
} }
std::string path_with_query = append_query_params(path, params); std::string path_with_query = append_query_params(path, params);
return Get(path_with_query.c_str(), headers, progress); return Get(path_with_query, headers, progress);
} }
inline Result ClientImpl::Get(const std::string &path, const Params &params, inline Result ClientImpl::Get(const std::string &path, const Params &params,
@ -8008,8 +8024,8 @@ inline Result ClientImpl::Get(const std::string &path, const Params &params,
} }
std::string path_with_query = append_query_params(path, params); std::string path_with_query = append_query_params(path, params);
return Get(path_with_query.c_str(), headers, response_handler, return Get(path_with_query, headers, response_handler, content_receiver,
content_receiver, progress); progress);
} }
inline Result ClientImpl::Head(const std::string &path) { inline Result ClientImpl::Head(const std::string &path) {
@ -8111,7 +8127,7 @@ inline Result ClientImpl::Post(const std::string &path, const Headers &headers,
const auto &content_type = const auto &content_type =
detail::serialize_multipart_formdata_get_content_type(boundary); detail::serialize_multipart_formdata_get_content_type(boundary);
const auto &body = detail::serialize_multipart_formdata(items, boundary); const auto &body = detail::serialize_multipart_formdata(items, boundary);
return Post(path, headers, body, content_type.c_str()); return Post(path, headers, body, content_type);
} }
inline Result ClientImpl::Post(const std::string &path, const Headers &headers, inline Result ClientImpl::Post(const std::string &path, const Headers &headers,
@ -8124,7 +8140,7 @@ inline Result ClientImpl::Post(const std::string &path, const Headers &headers,
const auto &content_type = const auto &content_type =
detail::serialize_multipart_formdata_get_content_type(boundary); detail::serialize_multipart_formdata_get_content_type(boundary);
const auto &body = detail::serialize_multipart_formdata(items, boundary); const auto &body = detail::serialize_multipart_formdata(items, boundary);
return Post(path, headers, body, content_type.c_str()); return Post(path, headers, body, content_type);
} }
inline Result inline Result
@ -8508,10 +8524,11 @@ inline void ClientImpl::set_ca_cert_store(X509_STORE *ca_cert_store) {
} }
inline X509_STORE *ClientImpl::create_ca_cert_store(const char *ca_cert, inline X509_STORE *ClientImpl::create_ca_cert_store(const char *ca_cert,
std::size_t size) { std::size_t size) const {
auto mem = BIO_new_mem_buf(ca_cert, static_cast<int>(size)); auto mem = BIO_new_mem_buf(ca_cert, static_cast<int>(size));
if (!mem) if (!mem) {
return nullptr; return nullptr;
}
auto inf = PEM_X509_INFO_read_bio(mem, nullptr, nullptr, nullptr); auto inf = PEM_X509_INFO_read_bio(mem, nullptr, nullptr, nullptr);
if (!inf) { if (!inf) {
@ -8676,7 +8693,7 @@ inline SSLSocketStream::SSLSocketStream(socket_t sock, SSL *ssl,
SSL_clear_mode(ssl, SSL_MODE_AUTO_RETRY); SSL_clear_mode(ssl, SSL_MODE_AUTO_RETRY);
} }
inline SSLSocketStream::~SSLSocketStream() {} inline SSLSocketStream::~SSLSocketStream() = default;
inline bool SSLSocketStream::is_readable() const { inline bool SSLSocketStream::is_readable() const {
return detail::select_read(sock_, read_timeout_sec_, read_timeout_usec_) > 0; return detail::select_read(sock_, read_timeout_sec_, read_timeout_usec_) > 0;
@ -8898,7 +8915,7 @@ inline SSLClient::SSLClient(const std::string &host, int port,
detail::split(&host_[0], &host_[host_.size()], '.', detail::split(&host_[0], &host_[host_.size()], '.',
[&](const char *b, const char *e) { [&](const char *b, const char *e) {
host_components_.emplace_back(std::string(b, e)); host_components_.emplace_back(b, e);
}); });
if (!client_cert_path.empty() && !client_key_path.empty()) { if (!client_cert_path.empty() && !client_key_path.empty()) {
@ -8919,7 +8936,7 @@ inline SSLClient::SSLClient(const std::string &host, int port,
detail::split(&host_[0], &host_[host_.size()], '.', detail::split(&host_[0], &host_[host_.size()], '.',
[&](const char *b, const char *e) { [&](const char *b, const char *e) {
host_components_.emplace_back(std::string(b, e)); host_components_.emplace_back(b, e);
}); });
if (client_cert != nullptr && client_key != nullptr) { if (client_cert != nullptr && client_key != nullptr) {
@ -9197,8 +9214,8 @@ SSLClient::verify_host_with_subject_alt_name(X509 *server_cert) const {
auto type = GEN_DNS; auto type = GEN_DNS;
struct in6_addr addr6; struct in6_addr addr6 {};
struct in_addr addr; struct in_addr addr {};
size_t addr_len = 0; size_t addr_len = 0;
#ifndef __MINGW32__ #ifndef __MINGW32__
@ -9279,7 +9296,7 @@ inline bool SSLClient::check_host_name(const char *pattern,
std::vector<std::string> pattern_components; std::vector<std::string> pattern_components;
detail::split(&pattern[0], &pattern[pattern_len], '.', detail::split(&pattern[0], &pattern[pattern_len], '.',
[&](const char *b, const char *e) { [&](const char *b, const char *e) {
pattern_components.emplace_back(std::string(b, e)); pattern_components.emplace_back(b, e);
}); });
if (host_components_.size() != pattern_components.size()) { if (host_components_.size() != pattern_components.size()) {
@ -9364,7 +9381,7 @@ inline Client::Client(const std::string &host, int port,
: cli_(detail::make_unique<ClientImpl>(host, port, client_cert_path, : cli_(detail::make_unique<ClientImpl>(host, port, client_cert_path,
client_key_path)) {} client_key_path)) {}
inline Client::~Client() {} inline Client::~Client() = default;
inline bool Client::is_valid() const { inline bool Client::is_valid() const {
return cli_ != nullptr && cli_->is_valid(); return cli_ != nullptr && cli_->is_valid();

1615
3rd_party/json/json.hpp vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,24 @@
# Changelog # Changelog
## 2.0.1-rc ## v2.0.2-rc
### Issues ### Issues
* \#12 [Unit Test] Complete all providers unit tests
### Changes from v2.0.1-rc
* Updated `JSON for Modern C++` to v3.11.3
## v2.0.1-rc
* Removed legacy win32 build binaries
<!-- markdownlint-disable-next-line -->
### Issues
* \#10 Address compiler warnings * \#10 Address compiler warnings
* \#11 Switch to SQLite over RocksDB
### Changes from v2.0.0-rc ### Changes from v2.0.0-rc
@ -14,12 +28,12 @@
* Require `c++20` * Require `c++20`
* Switched to Storj over Filebase for hosting binaries * Switched to Storj over Filebase for hosting binaries
* Updated `boost` to v1.83.0 * Updated `boost` to v1.83.0
* Updated `cpp-httplib` to v0.14.2
* Updated `curl` to v8.4.0 * Updated `curl` to v8.4.0
* Updated `libsodium` to v1.0.19 * Updated `libsodium` to v1.0.19
* Updated `OpenSSL` to v3.1.4 * Updated `OpenSSL` to v3.2.0
* Updated `rocksdb` to v8.6.7
## 2.0.0-rc ## v2.0.0-rc
<!-- markdownlint-disable-next-line --> <!-- markdownlint-disable-next-line -->
### Issues ### Issues

View File

@ -11,7 +11,7 @@ include(ExternalProject)
set(REPERTORY_MAJOR 2) set(REPERTORY_MAJOR 2)
set(REPERTORY_MINOR 0) set(REPERTORY_MINOR 0)
set(REPERTORY_REV 1) set(REPERTORY_REV 2)
set(REPERTORY_RELEASE_NUM 0) set(REPERTORY_RELEASE_NUM 0)
set(REPERTORY_RELEASE_ITER rc) set(REPERTORY_RELEASE_ITER rc)
set(REPERTORY_VERSION ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}-${REPERTORY_RELEASE_ITER}) set(REPERTORY_VERSION ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}-${REPERTORY_RELEASE_ITER})
@ -74,9 +74,9 @@ if (LINUX OR MINGW)
endif() endif()
endif() endif()
if (REPERTORY_MUSL OR MINGW) if (REPERTORY_MUSL)
find_library(LIBPTHREAD_LIBRARY NO_CACHE NAMES libpthread.a) find_library(LIBPTHREAD_LIBRARY NO_CACHE NAMES libpthread.a)
else() elseif(NOT MINGW)
find_library(LIBPTHREAD_LIBRARY NO_CACHE NAMES pthread) find_library(LIBPTHREAD_LIBRARY NO_CACHE NAMES pthread)
endif() endif()
@ -91,7 +91,7 @@ if (LINUX OR MINGW)
set(REPERTORY_DEFINITIONS ${REPERTORY_DEFINITIONS} -DFUSE_USE_VERSION=29) set(REPERTORY_DEFINITIONS ${REPERTORY_DEFINITIONS} -DFUSE_USE_VERSION=29)
endif() endif()
if (NOT LIBPTHREAD_LIBRARY) if (NOT MINGW AND NOT LIBPTHREAD_LIBRARY)
message(FATAL_ERROR "'libpthread' not found") message(FATAL_ERROR "'libpthread' not found")
endif() endif()
@ -171,7 +171,7 @@ if (MINGW)
set(REPERTORY_VER_PRODUCTVERSION_STR ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}.${REPERTORY_RELEASE_NUM}) set(REPERTORY_VER_PRODUCTVERSION_STR ${REPERTORY_MAJOR}.${REPERTORY_MINOR}.${REPERTORY_REV}.${REPERTORY_RELEASE_NUM})
set(REPERTORY_VER_PRERELEASE VS_FF_PRERELEASE) set(REPERTORY_VER_PRERELEASE VS_FF_PRERELEASE)
set(REPERTORY_VER_COMPANYNAME_STR "https://git.fifthgrid.com/blockstorage") set(REPERTORY_VER_COMPANYNAME_STR "https://git.fifthgrid.com/blockstorage")
set(REPERTORY_VER_LEGALCOPYRIGHT_STR "Copyright 2018-2023 <MIT License> <https://git.fifthgrid.com/blockstorage/repertory>") set(REPERTORY_VER_LEGALCOPYRIGHT_STR "Copyright <2018-2024> <MIT License> <https://git.fifthgrid.com/blockstorage/repertory>")
set(REPERTORY_VER_FILEDESCRIPTION_STR "Mount utility for Sia and S3") set(REPERTORY_VER_FILEDESCRIPTION_STR "Mount utility for Sia and S3")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc @ONLY)
set(WINDOWS_VERSION_RC ${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc) set(WINDOWS_VERSION_RC ${CMAKE_CURRENT_SOURCE_DIR}/src/version.rc)
@ -215,7 +215,6 @@ include(cmake/zlib.cmake)
include(cmake/openssl.cmake) include(cmake/openssl.cmake)
include(cmake/curl.cmake) include(cmake/curl.cmake)
include(cmake/boost.cmake) include(cmake/boost.cmake)
include(cmake/rocksdb.cmake)
include(cmake/libsodium.cmake) include(cmake/libsodium.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/common.cpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/common.cpp @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/common.cpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/common.cpp @ONLY)
@ -227,15 +226,14 @@ include_directories(SYSTEM
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/stduuid ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/stduuid
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/json ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/json
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/pugixml/src ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/pugixml/src
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/sqlite/include
${CURL_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}
${LIBFUSE2_INCLUDE_DIRS} ${LIBFUSE2_INCLUDE_DIRS}
${LIBFUSE3_INCLUDE_DIRS} ${LIBFUSE3_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}
${ROCKSDB_INCLUDE_DIRS}
) )
set(REPERTORY_LINK_LIBRARIES set(REPERTORY_LINK_LIBRARIES
${ROCKSDB_LIBRARIES}
${LIBFUSE2_LIBRARIES} ${LIBFUSE2_LIBRARIES}
${LIBFUSE3_LIBRARIES} ${LIBFUSE3_LIBRARIES}
${Boost_LIBRARIES} ${Boost_LIBRARIES}
@ -254,12 +252,14 @@ file(GLOB_RECURSE REPERTORY_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/include/**/*.hh ${CMAKE_CURRENT_SOURCE_DIR}/include/**/*.hh
${CMAKE_CURRENT_SOURCE_DIR}/include/**/*.hpp ${CMAKE_CURRENT_SOURCE_DIR}/include/**/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/pugixml/src/*.hpp ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/pugixml/src/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/sqlite/include/*.h
) )
file(GLOB_RECURSE REPERTORY_SOURCES file(GLOB_RECURSE REPERTORY_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/**/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/pugixml/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/pugixml/src/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/3rd_party/sqlite/src/*.c
) )
list(REMOVE_ITEM REPERTORY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp) list(REMOVE_ITEM REPERTORY_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)

View File

@ -1,5 +1,5 @@
# Repertory MIT License # Repertory MIT License
### Copyright <2018-2023> <scott.e.graves@protonmail.com> ### Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -16,13 +16,11 @@ on Windows.
* [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support * [Sia renterd](https://github.com/SiaFoundation/renterd/releases) v0.4.0+ for Sia support
* Only 64-bit operating systems are supported * Only 64-bit operating systems are supported
* Linux requires the following dependencies: * Linux requires `fusermount3` or `repertory` must be manually compiled with `libfuse2` support
* `libfuse3`
* OS X requires the following dependency to be installed: * OS X requires the following dependency to be installed:
* [FUSE for macOS v4.5.0](https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.5.0/macfuse-4.5.0.dmg) * [FUSE for macOS v4.5.0](https://github.com/osxfuse/osxfuse/releases/download/macfuse-4.5.0/macfuse-4.5.0.dmg)
* Windows requires the following dependencies to be installed: * Windows requires the following dependencies to be installed:
* [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi) * [WinFSP 2023](https://github.com/winfsp/winfsp/releases/download/v2.0/winfsp-2.0.23075.msi)
* [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://aka.ms/vs/16/release/vc_redist.x64.exe)
## Supported Operating Systems ## Supported Operating Systems
@ -42,10 +40,9 @@ on Windows.
* [libfuse](https://github.com/libfuse/libfuse) * [libfuse](https://github.com/libfuse/libfuse)
* [libsodium](https://doc.libsodium.org/) * [libsodium](https://doc.libsodium.org/)
* [OpenSSL](https://www.openssl.org/) * [OpenSSL](https://www.openssl.org/)
* [OSSP uuid](http://www.ossp.org/pkg/lib/uuid/)
* [RocksDB](https://rocksdb.org/)
* [ScPrime](https://scpri.me/) * [ScPrime](https://scpri.me/)
* [Sia Decentralized Cloud Storage](https://sia.tech/) * [Sia Decentralized Cloud Storage](https://sia.tech/)
* [SQLite](https://www.sqlite.org)
* [stduuid](https://github.com/mariusbancila/stduuid) * [stduuid](https://github.com/mariusbancila/stduuid)
* [Storj](https://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)
@ -80,4 +77,3 @@ mMH3segHBkRj0xJcfOxceRLj1a+ULIIR3xL/3f8s5Id25TDo/nqBoCvu5PeCpo6L
9wIDAQAB 9wIDAQAB
-----END PUBLIC KEY----- -----END PUBLIC KEY-----
``` ```

View File

@ -1,5 +1,19 @@
set(BOOST_VERSION ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_REVISION}) if (MINGW)
set(BOOST_VERSION2 ${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_REVISION}) include_directories(SYSTEM /mingw/include/boost-${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION})
set(Boost_LIBRARIES
/mingw64/lib/libboost_system.a
/mingw64/lib/libboost_atomic.a
/mingw64/lib/libboost_chrono.a
/mingw64/lib/libboost_date_time.a
/mingw64/lib/libboost_filesystem.a
/mingw64/lib/libboost_random.a
/mingw64/lib/libboost_regex.a
/mingw64/lib/libboost_serialization.a
/mingw64/lib/libboost_thread.a
)
else()
set(BOOST_VERSION ${BOOST_MAJOR_VERSION}.${BOOST_MINOR_VERSION}.${BOOST_PATCH_VERSION})
set(BOOST_VERSION2 ${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}_${BOOST_PATCH_VERSION})
set(BOOST_PROJECT_NAME boost_${BOOST_VERSION}) set(BOOST_PROJECT_NAME boost_${BOOST_VERSION})
set(BOOST_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${BOOST_PROJECT_NAME}) set(BOOST_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${BOOST_PROJECT_NAME})
@ -38,16 +52,6 @@ set (BOOST_COMMON_ARGS
-sZLIB_INCLUDE="${EXTERNAL_BUILD_ROOT}/include" -sZLIB_INCLUDE="${EXTERNAL_BUILD_ROOT}/include"
) )
if (MINGW)
if (NOT CMAKE_HOST_WIN32)
set(BOOST_COMMON_ARGS
${BOOST_COMMON_ARGS}
--user-config=./user-config.jam
)
endif()
set(BOOST_TARGET_OS target-os=windows)
endif()
ExternalProject_Add(boost_project ExternalProject_Add(boost_project
DOWNLOAD_NO_PROGRESS 1 DOWNLOAD_NO_PROGRESS 1
URL ${BOOST_DOWNLOAD_URL} URL ${BOOST_DOWNLOAD_URL}
@ -72,26 +76,20 @@ ExternalProject_Add(boost_project
add_dependencies(boost_project openssl_project) add_dependencies(boost_project openssl_project)
if (MINGW AND CMAKE_HOST_WIN32)
set(BOOST_GCC_VERSION ${CMAKE_CXX_COMPILER_VERSION})
string(REPLACE "." ";" BOOST_GCC_VERSION_LIST ${BOOST_GCC_VERSION})
list(GET BOOST_GCC_VERSION_LIST 0 BOOST_GCC_MAJOR_VERSION)
set(BOOST_LIB_EXTRA "-mgw${BOOST_GCC_MAJOR_VERSION}-mt${DEBUG_EXTRA2}-x64-${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}")
endif()
set(Boost_LIBRARIES
libboost_system${BOOST_LIB_EXTRA}.a
libboost_atomic${BOOST_LIB_EXTRA}.a
libboost_chrono${BOOST_LIB_EXTRA}.a
libboost_date_time${BOOST_LIB_EXTRA}.a
libboost_filesystem${BOOST_LIB_EXTRA}.a
libboost_random${BOOST_LIB_EXTRA}.a
libboost_regex${BOOST_LIB_EXTRA}.a
libboost_serialization${BOOST_LIB_EXTRA}.a
libboost_thread${BOOST_LIB_EXTRA}.a
)
add_dependencies(boost_project zlib_project) add_dependencies(boost_project zlib_project)
if (CMAKE_HOST_WIN32) if (CMAKE_HOST_WIN32)
include_directories(SYSTEM ${EXTERNAL_BUILD_ROOT}/include/boost-${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION}) include_directories(SYSTEM ${EXTERNAL_BUILD_ROOT}/include/boost-${BOOST_MAJOR_VERSION}_${BOOST_MINOR_VERSION})
endif() endif()
set(Boost_LIBRARIES
libboost_system.a
libboost_atomic.a
libboost_chrono.a
libboost_date_time.a
libboost_filesystem.a
libboost_random.a
libboost_regex.a
libboost_serialization.a
libboost_thread.a
)
endif()

View File

@ -1,9 +1,13 @@
if (MINGW)
find_package(CURL REQUIRED)
set(CURL_LIBRARIES /mingw64/lib/libcurl.a)
else()
set(CURL_PROJECT_NAME curl_${CURL_VERSION}) set(CURL_PROJECT_NAME curl_${CURL_VERSION})
set(CURL_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${CURL_PROJECT_NAME}) set(CURL_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${CURL_PROJECT_NAME})
if (OPENSSL_ROOT_DIR) if (OPENSSL_ROOT_DIR)
set(CURL_OPENSSL_EXTRA -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}) set(CURL_OPENSSL_EXTRA -DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR})
elseif(LINUX OR MINGW) elseif(LINUX)
set(CURL_OPENSSL_EXTRA -DOPENSSL_ROOT_DIR=${EXTERNAL_BUILD_ROOT}) set(CURL_OPENSSL_EXTRA -DOPENSSL_ROOT_DIR=${EXTERNAL_BUILD_ROOT})
endif() endif()
@ -25,6 +29,7 @@ set(CURL_CMAKE_ARGS
-DCURL_STATICLIB=ON -DCURL_STATICLIB=ON
-DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBPSL=OFF
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH2=OFF
-DCURL_USE_OPENSSL=ON
-DCURL_ZLIB=OFF -DCURL_ZLIB=OFF
-DENABLE_THREADED_RESOLVER=ON -DENABLE_THREADED_RESOLVER=ON
-DOPENSSL_USE_STATIC_LIBS=ON -DOPENSSL_USE_STATIC_LIBS=ON
@ -38,30 +43,18 @@ if (CMAKE_TOOLCHAIN_FILE)
) )
endif() endif()
if (MINGW)
set(CURL_CMAKE_ARGS
${CURL_CMAKE_ARGS}
-DCURL_USE_OPENSSL=OFF
-DUSE_WIN32_CRYPTO=ON
)
else()
set(CURL_CMAKE_ARGS
${CURL_CMAKE_ARGS}
-DCURL_USE_OPENSSL=ON
)
endif()
ExternalProject_Add(curl_project ExternalProject_Add(curl_project
DOWNLOAD_NO_PROGRESS 1 DOWNLOAD_NO_PROGRESS 1
URL https://github.com/curl/curl/archive/curl-${CURL_VERSION}.tar.gz URL https://curl.se/download/curl-${CURL_VERSION}.tar.gz
PREFIX ${CURL_BUILD_ROOT} PREFIX ${CURL_BUILD_ROOT}
CMAKE_ARGS ${CURL_CMAKE_ARGS} CMAKE_ARGS ${CURL_CMAKE_ARGS}
) )
set(REPERTORY_DEFINITIONS ${REPERTORY_DEFINITIONS} -DCURL_STATICLIB=ON -DCURL_DISABLE_LDAP=ON)
set(CURL_LIBRARIES libcurl${DEBUG_EXTRA2}${CMAKE_STATIC_LIBRARY_SUFFIX}) set(CURL_LIBRARIES libcurl${DEBUG_EXTRA2}${CMAKE_STATIC_LIBRARY_SUFFIX})
add_dependencies(curl_project add_dependencies(curl_project
openssl_project openssl_project
zlib_project zlib_project
) )
endif()
set(REPERTORY_DEFINITIONS ${REPERTORY_DEFINITIONS} -DCURL_STATICLIB=ON -DCURL_DISABLE_LDAP=ON)

View File

@ -57,7 +57,7 @@ if (UNIX OR MINGW)
-Wnon-virtual-dtor -Wnon-virtual-dtor
-Wold-style-cast -Wold-style-cast
-Woverloaded-virtual -Woverloaded-virtual
-Wuseless-cast -Wno-useless-cast
) )
endif() endif()

View File

@ -19,13 +19,6 @@ endfunction(copy_support_files)
function(set_common_target_options name) function(set_common_target_options name)
target_compile_definitions(${name} PUBLIC ${REPERTORY_DEFINITIONS}) target_compile_definitions(${name} PUBLIC ${REPERTORY_DEFINITIONS})
if (UNIX OR MINGW)
target_compile_options(${name} PRIVATE
${REPERTORY_GCC_CXX_FLAGS}
${REPERTORY_GCC_FLAGS}
)
endif()
target_precompile_headers(${name} PRIVATE include/common.hpp) target_precompile_headers(${name} PRIVATE include/common.hpp)
if (MACOS) if (MACOS)
@ -35,8 +28,8 @@ function(set_common_target_options name)
if (UNIX OR MINGW) if (UNIX OR MINGW)
target_compile_options(${name} PRIVATE target_compile_options(${name} PRIVATE
${REPERTORY_GCC_CXX_FLAGS} $<$<COMPILE_LANGUAGE:CXX>:${REPERTORY_GCC_CXX_FLAGS}>
${REPERTORY_GCC_FLAGS} $<$<COMPILE_LANGUAGE:C>:${REPERTORY_GCC_FLAGS}>
) )
endif() endif()
endfunction(set_common_target_options) endfunction(set_common_target_options)

View File

@ -12,11 +12,12 @@ set_common_target_options(librepertory)
set_target_properties(librepertory PROPERTIES PREFIX "") set_target_properties(librepertory PROPERTIES PREFIX "")
target_link_libraries(librepertory PRIVATE ${REPERTORY_LINK_LIBRARIES}) target_link_libraries(librepertory PRIVATE ${REPERTORY_LINK_LIBRARIES})
if (NOT MINGW)
add_dependencies(librepertory add_dependencies(librepertory
boost_project boost_project
curl_project curl_project
libsodium_project libsodium_project
openssl_project openssl_project
rocksdb_project
zlib_project zlib_project
) )
endif()

View File

@ -1,27 +1,29 @@
if (MINGW)
set(sodium_USE_STATIC_LIBS ON)
find_package(Sodium REQUIRED)
set(LIBSODIUM_LIBRARIES /mingw64/lib/libsodium.a)
else()
set(LIBSODIUM_PROJECT_NAME libsodium_${LIBSODIUM_VERSION}) set(LIBSODIUM_PROJECT_NAME libsodium_${LIBSODIUM_VERSION})
set(LIBSODIUM_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${LIBSODIUM_PROJECT_NAME}) set(LIBSODIUM_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${LIBSODIUM_PROJECT_NAME})
set(LIBSODIUM_BUILD_TYPE ${EXTERNAL_BUILD_TYPE}) set(LIBSODIUM_BUILD_TYPE ${EXTERNAL_BUILD_TYPE})
if (MINGW)
set(LIBSODIUM_HOST --host=x86_64-w64-mingw32)
endif()
ExternalProject_Add(libsodium_project ExternalProject_Add(libsodium_project
DOWNLOAD_NO_PROGRESS 1 DOWNLOAD_NO_PROGRESS 1
PREFIX ${LIBSODIUM_BUILD_ROOT} PREFIX ${LIBSODIUM_BUILD_ROOT}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
URL https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}-RELEASE/libsodium-${LIBSODIUM_VERSION}.tar.gz URL https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}-RELEASE/libsodium-${LIBSODIUM_VERSION}.tar.gz
CONFIGURE_COMMAND CONFIGURE_COMMAND ./configure
./configure
${LIBSODIUM_HOST}
--prefix=${EXTERNAL_BUILD_ROOT} --prefix=${EXTERNAL_BUILD_ROOT}
--enable-shared=no --enable-shared=no
--enable-static=yes --enable-static=yes
--disable-asm --disable-asm
--disable-ssp
${LIBSODIUM_HOST}
BUILD_COMMAND make BUILD_COMMAND make
INSTALL_COMMAND make install INSTALL_COMMAND make install
) )
set(LIBSODIUM_LIBRARIES libsodium.a)
add_dependencies(libsodium_project zlib_project) add_dependencies(libsodium_project zlib_project)
set(LIBSODIUM_LIBRARIES libsodium.a)
endif()

View File

@ -1,3 +1,11 @@
if (MINGW)
set($ENV:{OPENSSL_ROOT_DIR} /mingw64)
find_package(OpenSSL REQUIRED)
set(OPENSSL_LIBRARIES
/mingw64/lib64/libssl.a
/mingw64/lib64/libcrypto.a
)
else()
if (IS_CLANG_COMPILER) if (IS_CLANG_COMPILER)
set(OPENSSL_COMPILE_TYPE_EXTRA -clang) set(OPENSSL_COMPILE_TYPE_EXTRA -clang)
endif() endif()
@ -6,12 +14,6 @@ if (MACOS)
set(OPENSSL_COMPILE_TYPE darwin64-x86_64-cc) set(OPENSSL_COMPILE_TYPE darwin64-x86_64-cc)
elseif(IS_ARM64) elseif(IS_ARM64)
set(OPENSSL_COMPILE_TYPE linux-aarch64${OPENSSL_COMPILE_TYPE_EXTRA}) set(OPENSSL_COMPILE_TYPE linux-aarch64${OPENSSL_COMPILE_TYPE_EXTRA})
elseif(MINGW)
if (CMAKE_TOOLCHAIN_FILE)
set(OPENSSL_COMPILE_TYPE --cross-compile-prefix=x86_64-w64-mingw32- mingw64${OPENSSL_COMPILE_TYPE_EXTRA})
else()
set(OPENSSL_COMPILE_TYPE mingw64${OPENSSL_COMPILE_TYPE_EXTRA})
endif()
else() else()
set(OPENSSL_COMPILE_TYPE linux-x86_64${OPENSSL_COMPILE_TYPE_EXTRA}) set(OPENSSL_COMPILE_TYPE linux-x86_64${OPENSSL_COMPILE_TYPE_EXTRA})
endif() endif()
@ -23,8 +25,13 @@ ExternalProject_Add(openssl_project
URL https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz URL https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz
PREFIX ${OPENSSL_BUILD_ROOT} PREFIX ${OPENSSL_BUILD_ROOT}
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./Configure no-shared ${OPENSSL_COMPILE_TYPE} --openssldir=${EXTERNAL_BUILD_ROOT}/ssl --prefix=${EXTERNAL_BUILD_ROOT} CONFIGURE_COMMAND ./Configure
BUILD_COMMAND make -j1 ${OPENSSL_COMPILE_TYPE}
--prefix=${EXTERNAL_BUILD_ROOT}
no-apps
no-docs
no-shared
BUILD_COMMAND make
INSTALL_COMMAND make install INSTALL_COMMAND make install
) )
@ -34,3 +41,4 @@ set(OPENSSL_LIBRARIES
) )
add_dependencies(openssl_project zlib_project) add_dependencies(openssl_project zlib_project)
endif()

View File

@ -11,6 +11,17 @@ set(CMAKE_COLOR_MAKEFILE OFF)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
${CMAKE_MODULE_PATH}
)
if (MINGW)
set(CMAKE_MODULE_PATH
/mingw64/lib/cmake
/mingw64/lib64/cmake
${CMAKE_MODULE_PATH}
)
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON) set(THREADS_PREFER_PTHREAD_FLAG ON)
if (NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)

View File

@ -2,6 +2,24 @@
if (REPERTORY_ENABLE_TESTING) if (REPERTORY_ENABLE_TESTING)
enable_testing() enable_testing()
file(GLOB_RECURSE UNITTEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/mocks/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/utils/*.hpp
)
add_project_executable(unittests "${UNITTEST_SOURCES}")
if (MINGW)
find_package(GTest REQUIRED)
set(GTEST_LIBRARIES
/mingw64/lib/libgmock.a
/mingw64/lib/libgtest.a
/mingw64/lib/libgtest_main.a
)
else()
set(GTEST_PROJECT_NAME gtest_${GTEST_VERSION}) set(GTEST_PROJECT_NAME gtest_${GTEST_VERSION})
set(GTEST_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${GTEST_PROJECT_NAME}) set(GTEST_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${GTEST_PROJECT_NAME})
if (MACOS) if (MACOS)
@ -13,7 +31,7 @@ if (REPERTORY_ENABLE_TESTING)
endif() endif()
ExternalProject_Add(gtest_project ExternalProject_Add(gtest_project
DOWNLOAD_NO_PROGRESS 1 DOWNLOAD_NO_PROGRESS 1
URL https://github.com/google/googletest/archive/refs/tags/${GTEST_VERSION}.tar.gz URL https://github.com/google/googletest/archive/refs/tags/v${GTEST_VERSION}.tar.gz
PREFIX ${GTEST_BUILD_ROOT} PREFIX ${GTEST_BUILD_ROOT}
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@ -30,23 +48,12 @@ if (REPERTORY_ENABLE_TESTING)
${GTEST_BUILD_ROOT}/src/gtest_project/googlemock/include ${GTEST_BUILD_ROOT}/src/gtest_project/googlemock/include
) )
if(UNIX OR MINGW)
set(GTEST_LIBRARIES set(GTEST_LIBRARIES
${GTEST_BUILD_ROOT}/src/gtest_project-build/lib/libgmock.a ${GTEST_BUILD_ROOT}/src/gtest_project-build/lib/libgmock.a
${GTEST_BUILD_ROOT}/src/gtest_project-build/lib/libgtest.a ${GTEST_BUILD_ROOT}/src/gtest_project-build/lib/libgtest.a
${GTEST_BUILD_ROOT}/src/gtest_project-build/lib/libgtest_main.a ${GTEST_BUILD_ROOT}/src/gtest_project-build/lib/libgtest_main.a
) )
endif()
file(GLOB_RECURSE UNITTEST_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/mocks/*.hpp
${CMAKE_CURRENT_SOURCE_DIR}/tests/utils/*.hpp
)
add_project_executable(unittests "${UNITTEST_SOURCES}")
add_dependencies(unittests add_dependencies(unittests
gtest_project gtest_project
zlib_project zlib_project
@ -56,6 +63,12 @@ if (REPERTORY_ENABLE_TESTING)
GTEST_LINKED_AS_SHARED_LIBRARY=1 GTEST_LINKED_AS_SHARED_LIBRARY=1
REPERTORY_TESTING REPERTORY_TESTING
) )
endif()
target_compile_definitions(unittests PUBLIC
REPERTORY_TESTING
)
target_include_directories(unittests PUBLIC target_include_directories(unittests PUBLIC
${GTEST_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/tests ${CMAKE_CURRENT_SOURCE_DIR}/tests

View File

@ -1,11 +1,9 @@
set(BOOST_MAJOR_VERSION 1) set(BOOST_MAJOR_VERSION 1)
set(BOOST_MINOR_VERSION 83) set(BOOST_MINOR_VERSION 84)
set(BOOST_REVISION 0) set(BOOST_PATCH_VERSION 0)
set(CURL_VERSION 8_4_0) set(CURL_VERSION 8.5.0)
set(GTEST_VERSION v1.14.0) set(GTEST_VERSION 1.14.0)
set(LIBSODIUM_VERSION 1.0.19) set(LIBSODIUM_VERSION 1.0.19)
set(LIBUUID_VERSION 1.6.2) set(OPENSSL_VERSION 3.2.0)
set(OPENSSL_VERSION 3.1.4)
set(ROCKSDB_VERSION 8.6.7)
set(WINFSP_VERSION 2.0) set(WINFSP_VERSION 2.0)
set(ZLIB_VERSION v1.3) set(ZLIB_VERSION 1.3.1)

View File

@ -1,13 +1,17 @@
if (MINGW)
find_package(ZLIB REQUIRED)
set(ZLIB_LIBRARIES /mingw64/lib/libz.a)
else()
set(ZLIB_PROJECT_NAME zlib_${ZLIB_VERSION}) set(ZLIB_PROJECT_NAME zlib_${ZLIB_VERSION})
set(ZLIB_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${ZLIB_PROJECT_NAME}) set(ZLIB_BUILD_ROOT ${EXTERNAL_BUILD_ROOT}/builds/${ZLIB_PROJECT_NAME})
set(ZLIB_CMAKE_ARGS set(ZLIB_CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_BUILD_TYPE=${EXTERNAL_BUILD_TYPE} -DCMAKE_BUILD_TYPE=${EXTERNAL_BUILD_TYPE}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR} -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_INSTALL_PREFIX=${EXTERNAL_BUILD_ROOT} -DCMAKE_INSTALL_PREFIX=${EXTERNAL_BUILD_ROOT}
-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE} -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}
-DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
) )
if (CMAKE_TOOLCHAIN_FILE) if (CMAKE_TOOLCHAIN_FILE)
@ -19,13 +23,10 @@ endif()
ExternalProject_Add(zlib_project ExternalProject_Add(zlib_project
DOWNLOAD_NO_PROGRESS 1 DOWNLOAD_NO_PROGRESS 1
URL https://github.com/madler/zlib/archive/${ZLIB_VERSION}.tar.gz URL https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz
PREFIX ${ZLIB_BUILD_ROOT} PREFIX ${ZLIB_BUILD_ROOT}
CMAKE_ARGS ${ZLIB_CMAKE_ARGS} CMAKE_ARGS ${ZLIB_CMAKE_ARGS}
) )
if(MINGW)
set(ZLIB_LIBRARIES ${EXTERNAL_BUILD_ROOT}/lib/libzlibstatic${CMAKE_STATIC_LIBRARY_SUFFIX})
else()
set(ZLIB_LIBRARIES ${EXTERNAL_BUILD_ROOT}/lib/libz${CMAKE_STATIC_LIBRARY_SUFFIX}) set(ZLIB_LIBRARIES ${EXTERNAL_BUILD_ROOT}/lib/libz${CMAKE_STATIC_LIBRARY_SUFFIX})
endif() endif()

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -39,6 +39,9 @@ public:
[[nodiscard]] static auto default_data_directory(const provider_type &prov) [[nodiscard]] static auto default_data_directory(const provider_type &prov)
-> std::string; -> std::string;
[[nodiscard]] static auto default_remote_port(const provider_type &prov)
-> std::uint16_t;
[[nodiscard]] static auto default_rpc_port(const provider_type &prov) [[nodiscard]] static auto default_rpc_port(const provider_type &prov)
-> std::uint16_t; -> std::uint16_t;
@ -100,8 +103,8 @@ private:
s3_config s3_config_; s3_config s3_config_;
std::uint64_t version_ = REPERTORY_CONFIG_VERSION; std::uint64_t version_ = REPERTORY_CONFIG_VERSION;
std::string log_directory_; std::string log_directory_;
std::recursive_mutex read_write_mutex_; mutable std::recursive_mutex read_write_mutex_;
std::recursive_mutex remote_mount_mutex_; mutable std::recursive_mutex remote_mount_mutex_;
private: private:
[[nodiscard]] auto load() -> bool; [[nodiscard]] auto load() -> bool;
@ -109,6 +112,9 @@ private:
template <typename dest> template <typename dest>
auto get_value(const json &json_document, const std::string &name, dest &dst, auto get_value(const json &json_document, const std::string &name, dest &dst,
bool &success_flag) -> bool { bool &success_flag) -> bool {
constexpr const auto *function_name =
static_cast<const char *>(__FUNCTION__);
auto ret = false; auto ret = false;
try { try {
if (json_document.find(name) != json_document.end()) { if (json_document.find(name) != json_document.end()) {
@ -118,7 +124,7 @@ private:
success_flag = false; success_flag = false;
} }
} catch (const json::exception &ex) { } catch (const json::exception &ex) {
utils::error::raise_error(__FUNCTION__, ex, "exception occurred"); utils::error::raise_error(function_name, ex, "exception occurred");
success_flag = false; success_flag = false;
ret = false; ret = false;
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -227,6 +227,11 @@ public:
stop_type &stop_requested) const stop_type &stop_requested) const
-> bool override; -> bool override;
[[nodiscard]] auto make_request(const curl::requests::http_post &post_file,
long &response_code,
stop_type &stop_requested) const
-> bool override;
[[nodiscard]] auto make_request(const curl::requests::http_put_file &put_file, [[nodiscard]] auto make_request(const curl::requests::http_put_file &put_file,
long &response_code, long &response_code,
stop_type &stop_requested) const stop_type &stop_requested) const

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -25,6 +25,7 @@
#include "comm/curl/requests/http_delete.hpp" #include "comm/curl/requests/http_delete.hpp"
#include "comm/curl/requests/http_get.hpp" #include "comm/curl/requests/http_get.hpp"
#include "comm/curl/requests/http_head.hpp" #include "comm/curl/requests/http_head.hpp"
#include "comm/curl/requests/http_post.hpp"
#include "comm/curl/requests/http_put_file.hpp" #include "comm/curl/requests/http_put_file.hpp"
#include "types/repertory.hpp" #include "types/repertory.hpp"
@ -49,6 +50,11 @@ public:
stop_type &stop_requested) const stop_type &stop_requested) const
-> bool = 0; -> bool = 0;
[[nodiscard]] virtual auto make_request(const curl::requests::http_post &post,
long &response_code,
stop_type &stop_requested) const
-> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
make_request(const curl::requests::http_put_file &put_file, make_request(const curl::requests::http_put_file &put_file,
long &response_code, stop_type &stop_requested) const long &response_code, stop_type &stop_requested) const

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -30,8 +30,7 @@ namespace repertory {
class packet_client final { class packet_client final {
private: private:
struct client final { struct client final {
explicit client(boost::asio::io_context &ctx) : nonce(""), socket(ctx) {} explicit client(boost::asio::io_context &ctx) : socket(ctx) {}
std::string nonce; std::string nonce;
tcp::socket socket; tcp::socket socket;
}; };
@ -43,34 +42,40 @@ public:
~packet_client(); ~packet_client();
packet_client(const packet_client &) = delete;
packet_client(packet_client &&) = delete;
auto operator=(const packet_client &) -> packet_client & = delete;
auto operator=(packet_client &&) -> packet_client & = delete;
private: private:
boost::asio::io_context io_context_; boost::asio::io_context io_context_;
const std::string host_name_or_ip_; std::string host_name_or_ip_;
const std::uint8_t max_connections_; std::uint8_t max_connections_;
const std::uint16_t port_; std::uint16_t port_;
const std::uint16_t receive_timeout_; std::uint16_t receive_timeout_;
const std::uint16_t send_timeout_; std::uint16_t send_timeout_;
const std::string encryption_token_; std::string encryption_token_;
std::string unique_id_; std::string unique_id_;
bool allow_connections_ = true; private:
bool allow_connections_{true};
boost::asio::ip::basic_resolver<boost::asio::ip::tcp>::results_type boost::asio::ip::basic_resolver<boost::asio::ip::tcp>::results_type
resolve_results_; resolve_results_;
std::mutex clients_mutex_; std::mutex clients_mutex_;
std::vector<std::shared_ptr<client>> clients_; std::vector<std::shared_ptr<client>> clients_;
private: private:
void close(client &c) const; static void close(client &cli);
void close_all(); void close_all();
void connect(client &c); void connect(client &cli);
[[nodiscard]] auto get_client() -> std::shared_ptr<client>; [[nodiscard]] auto get_client() -> std::shared_ptr<client>;
void put_client(std::shared_ptr<client> &c); void put_client(std::shared_ptr<client> &cli);
[[nodiscard]] auto read_packet(client &c, packet &response) [[nodiscard]] auto read_packet(client &cli, packet &response)
-> packet::error_type; -> packet::error_type;
void resolve(); void resolve();

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -45,6 +45,12 @@ public:
~packet_server(); ~packet_server();
public:
packet_server(const packet_server &) = delete;
packet_server(packet_server &&) = delete;
auto operator=(const packet_server &) -> packet_server & = delete;
auto operator=(packet_server &&) -> packet_server & = delete;
private: private:
struct connection { struct connection {
connection(boost::asio::io_service &io_service, tcp::acceptor &acceptor_) connection(boost::asio::io_service &io_service, tcp::acceptor &acceptor_)
@ -56,11 +62,11 @@ private:
std::string client_id; std::string client_id;
std::string nonce; std::string nonce;
void generate_nonce() { nonce = utils::generate_random_string(256u); } void generate_nonce() { nonce = utils::generate_random_string(256U); }
}; };
private: private:
const std::string encryption_token_; std::string encryption_token_;
closed_callback closed_; closed_callback closed_;
message_handler_callback message_handler_; message_handler_callback message_handler_;
boost::asio::io_context io_context_; boost::asio::io_context io_context_;
@ -70,21 +76,22 @@ private:
std::unordered_map<std::string, std::uint32_t> connection_lookup_; std::unordered_map<std::string, std::uint32_t> connection_lookup_;
private: private:
void add_client(connection &c, const std::string &client_id); void add_client(connection &conn, const std::string &client_id);
void initialize(const uint16_t &port, uint8_t pool_size); void initialize(const uint16_t &port, uint8_t pool_size);
void listen_for_connection(tcp::acceptor &acceptor); void listen_for_connection(tcp::acceptor &acceptor);
void on_accept(std::shared_ptr<connection> c, boost::system::error_code ec); void on_accept(std::shared_ptr<connection> conn,
boost::system::error_code err);
void read_header(std::shared_ptr<connection> c); void read_header(std::shared_ptr<connection> conn);
void read_packet(std::shared_ptr<connection> c, std::uint32_t data_size); void read_packet(std::shared_ptr<connection> conn, std::uint32_t data_size);
void remove_client(connection &c); void remove_client(connection &conn);
void send_response(std::shared_ptr<connection> c, void send_response(std::shared_ptr<connection> conn,
const packet::error_type &result, packet &response); const packet::error_type &result, packet &response);
}; };
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,6 +22,33 @@
#ifndef INCLUDE_COMMON_HPP_ #ifndef INCLUDE_COMMON_HPP_
#define INCLUDE_COMMON_HPP_ #define INCLUDE_COMMON_HPP_
#if defined(__GNUC__)
// clang-format off
#define REPERTORY_IGNORE_WARNINGS_ENABLE() \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Waggressive-loop-optimizations\"") \
_Pragma("GCC diagnostic ignored \"-Wconversion\"") \
_Pragma("GCC diagnostic ignored \"-Wdouble-promotion\"") \
_Pragma("GCC diagnostic ignored \"-Wduplicated-branches\"") \
_Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"") \
_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") \
_Pragma("GCC diagnostic ignored \"-Wnull-dereference\"") \
_Pragma("GCC diagnostic ignored \"-Wsign-conversion\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
_Pragma("GCC diagnostic ignored \"-Wuseless-cast\"")
#define REPERTORY_IGNORE_WARNINGS_DISABLE() \
_Pragma("GCC diagnostic pop")
#else
#define REPERTORY_IGNORE_WARNINGS_ENABLE()
#define REPERTORY_IGNORE_WARNINGS_DISABLE()
#endif // defined(__GNUC__)
// clang-format on
#ifdef __cplusplus
REPERTORY_IGNORE_WARNINGS_ENABLE()
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
@ -95,6 +122,7 @@ template <typename data_type>
#include <boost/archive/text_iarchive.hpp> #include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_oarchive.hpp>
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/bind/bind.hpp> #include <boost/bind/bind.hpp>
#include <boost/dynamic_bitset.hpp> #include <boost/dynamic_bitset.hpp>
#include <boost/dynamic_bitset/serialization.hpp> #include <boost/dynamic_bitset/serialization.hpp>
@ -103,7 +131,7 @@ template <typename data_type>
#include <curl/curl.h> #include <curl/curl.h>
#include <curl/multi.h> #include <curl/multi.h>
#include <json.hpp> #include <json.hpp>
#include <rocksdb/db.h> #include <sqlite3.h>
#include <stduuid.h> #include <stduuid.h>
#ifdef _WIN32 #ifdef _WIN32
@ -124,6 +152,8 @@ template <typename data_type>
#define CPPHTTPLIB_OPENSSL_SUPPORT #define CPPHTTPLIB_OPENSSL_SUPPORT
#include <httplib.h> #include <httplib.h>
REPERTORY_IGNORE_WARNINGS_DISABLE()
using namespace std::chrono_literals; using namespace std::chrono_literals;
using json = nlohmann::json; using json = nlohmann::json;
@ -356,17 +386,17 @@ enum {
}; };
struct FSP_FSCTL_FILE_INFO { struct FSP_FSCTL_FILE_INFO {
UINT32 FileAttributes; UINT32 FileAttributes{};
UINT32 ReparseTag; UINT32 ReparseTag{};
UINT64 AllocationSize; UINT64 AllocationSize{};
UINT64 FileSize; UINT64 FileSize{};
UINT64 CreationTime; UINT64 CreationTime{};
UINT64 LastAccessTime; UINT64 LastAccessTime{};
UINT64 LastWriteTime; UINT64 LastWriteTime{};
UINT64 ChangeTime; UINT64 ChangeTime{};
UINT64 IndexNumber; UINT64 IndexNumber{};
UINT32 HardLinks; UINT32 HardLinks{};
UINT32 EaSize; UINT32 EaSize{};
}; };
using FileInfo = FSP_FSCTL_FILE_INFO; using FileInfo = FSP_FSCTL_FILE_INFO;
@ -382,6 +412,13 @@ void repertory_init();
void repertory_shutdown(); void repertory_shutdown();
} // namespace repertory } // namespace repertory
namespace {
template <class... Ts> struct overloaded : Ts... {
using Ts::operator()...;
};
template <class... Ts> overloaded(Ts...) -> overloaded<Ts...>;
} // namespace
#define INTERFACE_SETUP(name) \ #define INTERFACE_SETUP(name) \
public: \ public: \
name(const name &) noexcept = delete; \ name(const name &) noexcept = delete; \
@ -395,4 +432,5 @@ protected: \
public: \ public: \
virtual ~name() = default virtual ~name() = default
#endif // __cplusplus
#endif // INCLUDE_COMMON_HPP_ #endif // INCLUDE_COMMON_HPP_

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -33,16 +33,20 @@ public:
private: private:
struct open_directory { struct open_directory {
directory_iterator *iterator; directory_iterator *iterator{nullptr};
std::chrono::system_clock::time_point last_update = std::chrono::system_clock::time_point last_update{
std::chrono::system_clock::now(); std::chrono::system_clock::now()};
}; };
public: public:
directory_cache() : single_thread_service_base("directory_cache") {} directory_cache() : single_thread_service_base("directory_cache") {}
~directory_cache() override = default; ~directory_cache() override = default;
directory_cache(const directory_cache &) = delete;
directory_cache(directory_cache &&) = delete;
auto operator=(const directory_cache &) -> directory_cache & = delete;
auto operator=(directory_cache &&) -> directory_cache & = delete;
private: private:
std::unordered_map<std::string, open_directory> directory_lookup_; std::unordered_map<std::string, open_directory> directory_lookup_;
std::recursive_mutex directory_mutex_; std::recursive_mutex directory_mutex_;

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -315,7 +315,7 @@ protected:
return api_error::not_implemented; return api_error::not_implemented;
} }
virtual void destroy_impl(void * /*ptr*/) { return; } virtual void destroy_impl(void * /*ptr*/);
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
fallocate_impl(std::string /*api_path*/, int /*mode*/, off_t /*offset*/, fallocate_impl(std::string /*api_path*/, int /*mode*/, off_t /*offset*/,

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -316,9 +316,6 @@ public:
[[nodiscard]] auto is_processing(const std::string &api_path) const [[nodiscard]] auto is_processing(const std::string &api_path) const
-> bool override; -> bool override;
void populate_stat(const directory_item &dir_item,
struct stat &st) const override;
[[nodiscard]] auto rename_directory(const std::string &from_api_path, [[nodiscard]] auto rename_directory(const std::string &from_api_path,
const std::string &to_api_path) const std::string &to_api_path)
-> int override; -> int override;

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -69,9 +69,6 @@ public:
[[nodiscard]] virtual auto is_processing(const std::string &api_path) const [[nodiscard]] virtual auto is_processing(const std::string &api_path) const
-> bool = 0; -> bool = 0;
virtual void populate_stat(const directory_item &dir_item,
struct stat &st) const = 0;
[[nodiscard]] virtual auto rename_directory(const std::string &from_api_path, [[nodiscard]] virtual auto rename_directory(const std::string &from_api_path,
const std::string &to_api_path) const std::string &to_api_path)
-> int = 0; -> int = 0;

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -57,10 +57,9 @@ public:
remote::file_offset &length, const remote::file_offset &length, const remote::file_offset &length, const remote::file_offset &length, const
remote::file_handle &handle) = 0;*/ remote::file_handle &handle) = 0;*/
[[nodiscard]] virtual auto fuse_fgetattr(const char *path, remote::stat &st, [[nodiscard]] virtual auto
bool &directory, fuse_fgetattr(const char *path, remote::stat &r_stat, bool &directory,
const remote::file_handle &handle) const remote::file_handle &handle) -> packet::error_type = 0;
-> packet::error_type = 0;
[[nodiscard]] virtual auto fuse_fsetattr_x(const char *path, [[nodiscard]] virtual auto fuse_fsetattr_x(const char *path,
const remote::setattr_x &attr, const remote::setattr_x &attr,
@ -77,8 +76,8 @@ public:
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type = 0; -> packet::error_type = 0;
[[nodiscard]] virtual auto fuse_getattr(const char *path, remote::stat &st, [[nodiscard]] virtual auto fuse_getattr(const char *path,
bool &directory) remote::stat &r_stat, bool &directory)
-> packet::error_type = 0; -> packet::error_type = 0;
/*[[nodiscard]] virtual packet::error_type fuse_getxattr(const char *path, /*[[nodiscard]] virtual packet::error_type fuse_getxattr(const char *path,
@ -112,14 +111,14 @@ public:
-> packet::error_type = 0; -> packet::error_type = 0;
[[nodiscard]] virtual auto fuse_read(const char *path, char *buffer, [[nodiscard]] virtual auto fuse_read(const char *path, char *buffer,
const remote::file_size &readSize, const remote::file_size &read_size,
const remote::file_offset &readOffset, const remote::file_offset &read_offset,
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type = 0; -> packet::error_type = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
fuse_readdir(const char *path, const remote::file_offset &offset, fuse_readdir(const char *path, const remote::file_offset &offset,
const remote::file_handle &handle, std::string &itemPath) const remote::file_handle &handle, std::string &item_path)
-> packet::error_type = 0; -> packet::error_type = 0;
[[nodiscard]] virtual auto fuse_release(const char *path, [[nodiscard]] virtual auto fuse_release(const char *path,
@ -167,11 +166,11 @@ public:
std::int32_t &flags, std::uint32_t position) = 0;*/ std::int32_t &flags, std::uint32_t position) = 0;*/
[[nodiscard]] virtual auto fuse_statfs(const char *path, std::uint64_t frsize, [[nodiscard]] virtual auto fuse_statfs(const char *path, std::uint64_t frsize,
remote::statfs &st) remote::statfs &r_stat)
-> packet::error_type = 0; -> packet::error_type = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
fuse_statfs_x(const char *path, std::uint64_t bsize, remote::statfs_x &st) fuse_statfs_x(const char *path, std::uint64_t bsize, remote::statfs_x &r_stat)
-> packet::error_type = 0; -> packet::error_type = 0;
[[nodiscard]] virtual auto fuse_truncate(const char *path, [[nodiscard]] virtual auto fuse_truncate(const char *path,

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -53,7 +53,8 @@ private:
bool was_mounted_ = false; bool was_mounted_ = false;
private: private:
void populate_stat(const remote::stat &r, bool directory, struct stat &st); void populate_stat(const remote::stat &r_stat, bool directory,
struct stat &unix_st);
protected: protected:
[[nodiscard]] auto access_impl(std::string api_path, int mask) [[nodiscard]] auto access_impl(std::string api_path, int mask)
@ -66,7 +67,7 @@ protected:
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode, [[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode) [[nodiscard]] auto chmod_impl(std::string api_path, mode_t mode)
@ -75,7 +76,7 @@ protected:
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid, [[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid) [[nodiscard]] auto chown_impl(std::string api_path, uid_t uid, gid_t gid)
@ -83,37 +84,38 @@ protected:
#endif #endif
[[nodiscard]] auto create_impl(std::string api_path, mode_t mode, [[nodiscard]] auto create_impl(std::string api_path, mode_t mode,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
void destroy_impl(void * /*ptr*/) override; void destroy_impl(void * /*ptr*/) override;
[[nodiscard]] auto fgetattr_impl(std::string api_path, struct stat *st, [[nodiscard]] auto fgetattr_impl(std::string api_path, struct stat *unix_st,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#ifdef __APPLE__ #ifdef __APPLE__
[[nodiscard]] auto fsetattr_x_impl(std::string api_path, [[nodiscard]] auto fsetattr_x_impl(std::string api_path,
struct setattr_x *attr, struct setattr_x *attr,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#endif // __APPLE__ #endif // __APPLE__
[[nodiscard]] auto fsync_impl(std::string api_path, int datasync, [[nodiscard]] auto fsync_impl(std::string api_path, int datasync,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#if FUSE_USE_VERSION < 30 #if FUSE_USE_VERSION < 30
[[nodiscard]] auto ftruncate_impl(std::string api_path, off_t size, [[nodiscard]] auto ftruncate_impl(std::string api_path, off_t size,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#endif #endif
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto getattr_impl(std::string api_path, struct stat *st, [[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto getattr_impl(std::string api_path, struct stat *st) [[nodiscard]] auto getattr_impl(std::string api_path, struct stat *unix_st)
-> api_error override; -> api_error override;
#endif #endif
@ -136,37 +138,38 @@ protected:
void notify_fuse_main_exit(int &ret) override; void notify_fuse_main_exit(int &ret) override;
[[nodiscard]] auto open_impl(std::string api_path, struct fuse_file_info *fi) [[nodiscard]] auto open_impl(std::string api_path,
struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
[[nodiscard]] auto opendir_impl(std::string api_path, [[nodiscard]] auto opendir_impl(std::string api_path,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
[[nodiscard]] auto read_impl(std::string api_path, char *buffer, [[nodiscard]] auto read_impl(std::string api_path, char *buffer,
size_t read_size, off_t read_offset, size_t read_size, off_t read_offset,
struct fuse_file_info *fi, struct fuse_file_info *f_info,
std::size_t &bytes_read) -> api_error override; std::size_t &bytes_read) -> api_error override;
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto readdir_impl(std::string api_path, void *buf, [[nodiscard]] auto readdir_impl(std::string api_path, void *buf,
fuse_fill_dir_t fuse_fill_dir, off_t offset, fuse_fill_dir_t fuse_fill_dir, off_t offset,
struct fuse_file_info *fi, struct fuse_file_info *f_info,
fuse_readdir_flags flags) fuse_readdir_flags flags)
-> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto readdir_impl(std::string api_path, void *buf, [[nodiscard]] auto readdir_impl(std::string api_path, void *buf,
fuse_fill_dir_t fuse_fill_dir, off_t offset, fuse_fill_dir_t fuse_fill_dir, off_t offset,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#endif #endif
[[nodiscard]] auto release_impl(std::string api_path, [[nodiscard]] auto release_impl(std::string api_path,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
[[nodiscard]] auto releasedir_impl(std::string api_path, [[nodiscard]] auto releasedir_impl(std::string api_path,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
@ -210,7 +213,7 @@ protected:
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto truncate_impl(std::string api_path, off_t size, [[nodiscard]] auto truncate_impl(std::string api_path, off_t size,
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto truncate_impl(std::string api_path, off_t size) [[nodiscard]] auto truncate_impl(std::string api_path, off_t size)
@ -222,7 +225,7 @@ protected:
#if FUSE_USE_VERSION >= 30 #if FUSE_USE_VERSION >= 30
[[nodiscard]] auto utimens_impl(std::string api_path, [[nodiscard]] auto utimens_impl(std::string api_path,
const struct timespec tv[2], const struct timespec tv[2],
struct fuse_file_info *fi) struct fuse_file_info *f_info)
-> api_error override; -> api_error override;
#else #else
[[nodiscard]] auto utimens_impl(std::string api_path, [[nodiscard]] auto utimens_impl(std::string api_path,
@ -232,7 +235,7 @@ protected:
[[nodiscard]] auto write_impl(std::string api_path, const char *buffer, [[nodiscard]] auto 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 *fi, struct fuse_file_info *f_info,
std::size_t &bytes_written) std::size_t &bytes_written)
-> api_error override; -> api_error override;
}; };

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -54,7 +54,7 @@ private:
const UINT32 &attributes, const UINT32 &attributes,
remote::file_info &file_info); remote::file_info &file_info);
static void populate_stat(const struct stat64 &st1, remote::stat &st); static void populate_stat(const struct stat64 &unix_st, remote::stat &r_stat);
[[nodiscard]] auto update_to_windows_format(json &item) -> json &; [[nodiscard]] auto update_to_windows_format(json &item) -> json &;
@ -88,7 +88,7 @@ public:
remote::file_offset &length, const remote::file_handle &handle) override remote::file_offset &length, const remote::file_handle &handle) override
;*/ ;*/
[[nodiscard]] auto fuse_fgetattr(const char *path, remote::stat &st, [[nodiscard]] auto fuse_fgetattr(const char *path, remote::stat &r_stat,
bool &directory, bool &directory,
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
@ -107,7 +107,7 @@ public:
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_getattr(const char *path, remote::stat &st, [[nodiscard]] auto fuse_getattr(const char *path, remote::stat &r_stat,
bool &directory) bool &directory)
-> packet::error_type override; -> packet::error_type override;
@ -196,11 +196,11 @@ public:
std::int32_t &flags, std::uint32_t position) override ;*/ std::int32_t &flags, std::uint32_t position) override ;*/
[[nodiscard]] auto fuse_statfs(const char *path, std::uint64_t frsize, [[nodiscard]] auto fuse_statfs(const char *path, std::uint64_t frsize,
remote::statfs &st) remote::statfs &r_stat)
-> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_statfs_x(const char *path, std::uint64_t bsize, [[nodiscard]] auto fuse_statfs_x(const char *path, std::uint64_t bsize,
remote::statfs_x &st) remote::statfs_x &r_stat)
-> packet::error_type override; -> packet::error_type override;
[[nodiscard]] auto fuse_truncate(const char *path, [[nodiscard]] auto fuse_truncate(const char *path,

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -36,7 +36,7 @@
#include "utils/Base64.hpp" #include "utils/Base64.hpp"
#include "utils/path_utils.hpp" #include "utils/path_utils.hpp"
#define REPERTORY_DIRECTORY_PAGE_SIZE std::size_t(100u) #define REPERTORY_DIRECTORY_PAGE_SIZE std::size_t(100U)
namespace repertory { namespace repertory {
template <typename drive> template <typename drive>
@ -341,7 +341,7 @@ public:
ret = this->winfsp_read(file_desc, buffer.data(), offset, length, ret = this->winfsp_read(file_desc, buffer.data(), offset, length,
&bytes_transferred); &bytes_transferred);
if (ret == STATUS_SUCCESS) { if (ret == STATUS_SUCCESS) {
response.encode(static_cast<UINT32>(bytes_transferred)); response.encode(bytes_transferred);
if (bytes_transferred != 0U) { if (bytes_transferred != 0U) {
response.encode(buffer.data(), bytes_transferred); response.encode(buffer.data(), bytes_transferred);
} }
@ -1237,7 +1237,7 @@ public:
return -ERANGE; return -ERANGE;
} }
data_buffer buffer(static_cast<std::size_t>(write_size)); data_buffer buffer(write_size);
if ((ret = request->decode(buffer.data(), buffer.size())) == 0) { if ((ret = request->decode(buffer.data(), buffer.size())) == 0) {
remote::file_offset write_offset{}; remote::file_offset write_offset{};
DECODE_OR_RETURN(request, write_offset); DECODE_OR_RETURN(request, write_offset);
@ -1267,7 +1267,7 @@ public:
return -ERANGE; return -ERANGE;
} }
data_buffer buffer(static_cast<std::size_t>(write_size)); data_buffer buffer(write_size);
if ((ret = request->decode(buffer.data(), buffer.size())) == 0) { if ((ret = request->decode(buffer.data(), buffer.size())) == 0) {
buffer = macaron::Base64::Decode( buffer = macaron::Base64::Decode(
std::string(buffer.begin(), buffer.end())); std::string(buffer.begin(), buffer.end()));

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -46,8 +46,8 @@ private:
remote::file_info &file_info) remote::file_info &file_info)
-> packet::error_type; -> packet::error_type;
void populate_stat(const char *path, bool directory, remote::stat &st, void populate_stat(const char *path, bool directory, remote::stat &r_stat,
const struct _stat64 &st1); const struct _stat64 &unix_st);
public: public:
// FUSE Layer // FUSE Layer
@ -69,7 +69,7 @@ public:
&mode, const remote::file_offset &offset, const remote::file_offset &mode, const remote::file_offset &offset, const remote::file_offset
&length, const remote::file_handle &handle) override ;*/ &length, const remote::file_handle &handle) override ;*/
auto fuse_fgetattr(const char *path, remote::stat &st, bool &directory, auto fuse_fgetattr(const char *path, remote::stat &r_stat, bool &directory,
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
@ -85,7 +85,7 @@ public:
const remote::file_handle &handle) const remote::file_handle &handle)
-> packet::error_type override; -> packet::error_type override;
auto fuse_getattr(const char *path, remote::stat &st, bool &directory) auto fuse_getattr(const char *path, remote::stat &r_stat, bool &directory)
-> packet::error_type override; -> packet::error_type override;
/*packet::error_type fuse_getxattr(const char *path, const char *name, char /*packet::error_type fuse_getxattr(const char *path, const char *name, char
@ -174,11 +174,11 @@ public:
char *value, const remote::file_size &size, const std::int32_t &flags, char *value, const remote::file_size &size, const std::int32_t &flags,
std::uint32_t position) override ;*/ std::uint32_t position) override ;*/
auto fuse_statfs(const char *path, std::uint64_t frsize, remote::statfs &st) auto fuse_statfs(const char *path, std::uint64_t frsize,
-> packet::error_type override; remote::statfs &r_stat) -> packet::error_type override;
auto fuse_statfs_x(const char *path, std::uint64_t bsize, auto fuse_statfs_x(const char *path, std::uint64_t bsize,
remote::statfs_x &st) -> packet::error_type override; remote::statfs_x &r_stat) -> packet::error_type override;
auto fuse_truncate(const char *path, const remote::file_offset &size) auto fuse_truncate(const char *path, const remote::file_offset &size)
-> packet::error_type override; -> packet::error_type override;
@ -189,8 +189,8 @@ public:
std::uint64_t op0, std::uint64_t op1) std::uint64_t op0, std::uint64_t op1)
-> packet::error_type override; -> packet::error_type override;
void set_fuse_uid_gid(const remote::user_id &, void set_fuse_uid_gid(const remote::user_id & /* uid */,
const remote::group_id &) override {} const remote::group_id & /* gid */) override {}
// JSON Layer // JSON Layer
auto json_create_directory_snapshot(const std::string &path, json &json_data) auto json_create_directory_snapshot(const std::string &path, json &json_data)

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -143,9 +143,10 @@ public:
void shutdown() { ::GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); } void shutdown() { ::GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0); }
static void display_options(int argc, char *argv[]) {} static void display_options(int /* argc */, char * /* argv[] */) {}
static void display_version_information(int argc, char *argv[]) {} static void display_version_information(int /* argc */, char * /* argv[] */) {
}
}; };
} // namespace remote_winfsp } // namespace remote_winfsp
} // namespace repertory } // namespace repertory

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -193,9 +193,10 @@ public:
void shutdown(); void shutdown();
static void display_options(std::vector<const char *> args) {} static void display_options(std::vector<const char *> /* args */) {}
static void display_version_information(std::vector<const char *> args) {} static void
display_version_information(std::vector<const char *> /* args */) {}
}; };
} // namespace repertory } // namespace repertory

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -205,9 +205,8 @@ E_SIMPLE2(file_upload_queued, normal, true,
std::string, source, src, E_STRING std::string, source, src, E_STRING
); );
E_SIMPLE2(file_upload_removed, debug, true, E_SIMPLE1(file_upload_removed, debug, true,
std::string, api_path, ap, E_STRING, std::string, api_path, ap, E_STRING
std::string, source, src, E_STRING
); );
E_SIMPLE3(file_upload_retry, normal, true, E_SIMPLE3(file_upload_retry, normal, true,

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -22,11 +22,13 @@
#ifndef INCLUDE_FILE_MANAGER_FILE_MANAGER_HPP_ #ifndef INCLUDE_FILE_MANAGER_FILE_MANAGER_HPP_
#define INCLUDE_FILE_MANAGER_FILE_MANAGER_HPP_ #define INCLUDE_FILE_MANAGER_FILE_MANAGER_HPP_
#include "database/db_common.hpp"
#include "events/event_system.hpp" #include "events/event_system.hpp"
#include "events/events.hpp" #include "events/events.hpp"
#include "file_manager/i_file_manager.hpp" #include "file_manager/i_file_manager.hpp"
#include "file_manager/i_open_file.hpp" #include "file_manager/i_open_file.hpp"
#include "file_manager/i_upload_manager.hpp" #include "file_manager/i_upload_manager.hpp"
#include "platform/platform.hpp"
#include "types/repertory.hpp" #include "types/repertory.hpp"
#include "utils/native_file.hpp" #include "utils/native_file.hpp"
@ -133,6 +135,7 @@ public:
mutable std::mutex io_thread_mtx_; mutable std::mutex io_thread_mtx_;
std::condition_variable io_thread_notify_; std::condition_variable io_thread_notify_;
std::deque<std::shared_ptr<io_item>> io_thread_queue_; std::deque<std::shared_ptr<io_item>> io_thread_queue_;
bool removed_{false};
private: private:
void file_io_thread(); void file_io_thread();
@ -246,7 +249,8 @@ public:
std::size_t end_chunk_index_inclusive, std::size_t end_chunk_index_inclusive,
bool should_reset); bool should_reset);
private: void set_modified();
void update_background_reader(std::size_t read_chunk); void update_background_reader(std::size_t read_chunk);
protected: protected:
@ -266,13 +270,11 @@ public:
auto is_write_supported() const -> bool override { return true; } auto is_write_supported() const -> bool override { return true; }
[[nodiscard]] auto [[nodiscard]] auto native_operation(native_operation_callback callback)
native_operation(const native_operation_callback &callback)
-> api_error override; -> api_error override;
[[nodiscard]] auto [[nodiscard]] auto native_operation(std::uint64_t new_file_size,
native_operation(std::uint64_t new_file_size, native_operation_callback callback)
const native_operation_callback &callback)
-> api_error override; -> api_error override;
void remove(std::uint64_t handle) override; void remove(std::uint64_t handle) override;
@ -361,12 +363,11 @@ public:
auto is_write_supported() const -> bool override { return false; } auto is_write_supported() const -> bool override { return false; }
[[nodiscard]] auto [[nodiscard]] auto native_operation(native_operation_callback callback)
native_operation(const native_operation_callback &callback)
-> api_error override; -> api_error override;
[[nodiscard]] auto native_operation(std::uint64_t, [[nodiscard]] auto native_operation(std::uint64_t,
const native_operation_callback &) native_operation_callback)
-> api_error override { -> api_error override {
return api_error::not_supported; return api_error::not_supported;
} }
@ -449,17 +450,14 @@ public:
private: private:
app_config &config_; app_config &config_;
i_provider &provider_; i_provider &provider_;
std::unique_ptr<rocksdb::DB> db_;
private: private:
rocksdb::ColumnFamilyHandle *default_family_{}; db::db3_t db_{nullptr};
std::uint64_t next_handle_ = 0u; std::uint64_t next_handle_{0U};
mutable std::recursive_mutex open_file_mtx_; mutable std::recursive_mutex open_file_mtx_;
std::unordered_map<std::string, std::shared_ptr<i_closeable_open_file>> std::unordered_map<std::string, std::shared_ptr<i_closeable_open_file>>
open_file_lookup_; open_file_lookup_;
stop_type stop_requested_ = false; stop_type stop_requested_{false};
rocksdb::ColumnFamilyHandle *upload_family_{};
rocksdb::ColumnFamilyHandle *upload_active_family_{};
std::unordered_map<std::string, std::unique_ptr<upload>> upload_lookup_; std::unordered_map<std::string, std::unique_ptr<upload>> upload_lookup_;
mutable std::mutex upload_mtx_; mutable std::mutex upload_mtx_;
std::condition_variable upload_notify_; std::condition_variable upload_notify_;

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -40,6 +40,9 @@ public:
[[nodiscard]] virtual auto get_filesystem_item() const -> filesystem_item = 0; [[nodiscard]] virtual auto get_filesystem_item() const -> filesystem_item = 0;
[[nodiscard]] virtual auto get_open_data() const
-> std::map<std::uint64_t, open_file_data> = 0;
[[nodiscard]] virtual auto get_open_data(std::uint64_t handle) const [[nodiscard]] virtual auto get_open_data(std::uint64_t handle) const
-> open_file_data = 0; -> open_file_data = 0;
@ -58,11 +61,11 @@ public:
[[nodiscard]] virtual auto has_handle(std::uint64_t handle) const -> bool = 0; [[nodiscard]] virtual auto has_handle(std::uint64_t handle) const -> bool = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
native_operation(const native_operation_callback &callback) -> api_error = 0; native_operation(native_operation_callback callback) -> api_error = 0;
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
native_operation(std::uint64_t new_file_size, native_operation(std::uint64_t new_file_size,
const native_operation_callback &callback) -> api_error = 0; native_operation_callback callback) -> api_error = 0;
[[nodiscard]] virtual auto read(std::size_t read_size, [[nodiscard]] virtual auto read(std::size_t read_size,
std::uint64_t read_offset, data_buffer &data) std::uint64_t read_offset, data_buffer &data)
@ -91,9 +94,6 @@ public:
[[nodiscard]] virtual auto get_handles() const [[nodiscard]] virtual auto get_handles() const
-> std::vector<std::uint64_t> = 0; -> std::vector<std::uint64_t> = 0;
[[nodiscard]] virtual auto get_open_data() const
-> std::map<std::uint64_t, open_file_data> = 0;
[[nodiscard]] virtual auto is_complete() const -> bool = 0; [[nodiscard]] virtual auto is_complete() const -> bool = 0;
[[nodiscard]] virtual auto is_modified() const -> bool = 0; [[nodiscard]] virtual auto is_modified() const -> bool = 0;

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -23,6 +23,7 @@
#define INCLUDE_PROVIDERS_BASE_PROVIDER_HPP_ #define INCLUDE_PROVIDERS_BASE_PROVIDER_HPP_
#include "providers/i_provider.hpp" #include "providers/i_provider.hpp"
#include "providers/meta_db.hpp"
#include "types/repertory.hpp" #include "types/repertory.hpp"
namespace repertory { namespace repertory {
@ -41,8 +42,7 @@ private:
private: private:
api_item_added_callback api_item_added_; api_item_added_callback api_item_added_;
std::unique_ptr<rocksdb::DB> db_; std::unique_ptr<meta_db> db3_;
std::string DB_NAME = "meta_db";
i_file_manager *fm_{}; i_file_manager *fm_{};
private: private:
@ -83,12 +83,12 @@ protected:
return config_; return config_;
} }
[[nodiscard]] auto get_db() -> meta_db & { return *db3_; }
[[nodiscard]] virtual auto [[nodiscard]] virtual auto
get_directory_items_impl(const std::string &api_path, get_directory_items_impl(const std::string &api_path,
directory_item_list &list) const -> api_error = 0; directory_item_list &list) const -> api_error = 0;
[[nodiscard]] auto get_db() const -> rocksdb::DB * { return db_.get(); }
[[nodiscard]] auto get_file_mgr() -> i_file_manager * { return fm_; } [[nodiscard]] auto get_file_mgr() -> i_file_manager * { return fm_; }
[[nodiscard]] auto get_file_mgr() const -> const i_file_manager * { [[nodiscard]] auto get_file_mgr() const -> const i_file_manager * {

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -23,6 +23,7 @@
#define INCLUDE_PROVIDERS_ENCRYPT_ENCRYPT_PROVIDER_HPP_ #define INCLUDE_PROVIDERS_ENCRYPT_ENCRYPT_PROVIDER_HPP_
#include "app_config.hpp" #include "app_config.hpp"
#include "database/db_common.hpp"
#include "providers/i_provider.hpp" #include "providers/i_provider.hpp"
#include "utils/encrypting_reader.hpp" #include "utils/encrypting_reader.hpp"
@ -49,11 +50,7 @@ private:
private: private:
app_config &config_; app_config &config_;
std::unique_ptr<rocksdb::DB> db_; db::db3_t db_;
rocksdb::ColumnFamilyHandle *dir_family_{};
rocksdb::ColumnFamilyHandle *file_family_{};
rocksdb::ColumnFamilyHandle *source_family_{};
std::string DB_NAME = "meta_db";
private: private:
i_file_manager *fm_ = nullptr; i_file_manager *fm_ = nullptr;
@ -68,10 +65,16 @@ private:
static void create_item_meta(api_meta_map &meta, bool directory, static void create_item_meta(api_meta_map &meta, bool directory,
const api_file &file); const api_file &file);
[[nodiscard]] auto auto do_fs_operation(const std::string &api_path, bool directory,
std::function<api_error(const encrypt_config &cfg,
const std::string &source_path)>
callback) const -> api_error;
auto
process_directory_entry(const std::filesystem::directory_entry &dir_entry, process_directory_entry(const std::filesystem::directory_entry &dir_entry,
const encrypt_config &cfg, const encrypt_config &cfg,
std::string &api_path) const -> bool; std::string &api_path) const -> bool;
void remove_deleted_files(); void remove_deleted_files();
public: public:

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* /*
Copyright <2018-2023> <scott.e.graves@protonmail.com> Copyright <2018-2024> <scott.e.graves@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -99,7 +99,7 @@ public:
[[nodiscard]] auto is_online() const -> bool override; [[nodiscard]] auto is_online() const -> bool override;
[[nodiscard]] auto is_rename_supported() const -> bool override { [[nodiscard]] auto is_rename_supported() const -> bool override {
return false; return true;
} }
[[nodiscard]] auto read_file_bytes(const std::string &api_path, [[nodiscard]] auto read_file_bytes(const std::string &api_path,

View File

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

View File

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

View File

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

View File

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

View File

@ -23,6 +23,8 @@
#define INCLUDE_TYPES_REPERTORY_HPP_ #define INCLUDE_TYPES_REPERTORY_HPP_
namespace repertory { namespace repertory {
constexpr const auto max_time = 0xFFFFFFFFFFFFFFFFULL;
const std::string META_ACCESSED = "accessed"; const std::string META_ACCESSED = "accessed";
const std::string META_ATTRIBUTES = "attributes"; const std::string META_ATTRIBUTES = "attributes";
const std::string META_BACKUP = "backup"; const std::string META_BACKUP = "backup";
@ -30,7 +32,6 @@ const std::string META_CHANGED = "changed";
const std::string META_CREATION = "creation"; const std::string META_CREATION = "creation";
const std::string META_DIRECTORY = "directory"; const std::string META_DIRECTORY = "directory";
const std::string META_GID = "gid"; const std::string META_GID = "gid";
const std::string META_ID = "id";
const std::string META_KEY = "key"; const std::string META_KEY = "key";
const std::string META_MODE = "mode"; const std::string META_MODE = "mode";
const std::string META_MODIFIED = "modified"; const std::string META_MODIFIED = "modified";
@ -42,10 +43,10 @@ const std::string META_UID = "uid";
const std::string META_WRITTEN = "written"; const std::string META_WRITTEN = "written";
const std::vector<std::string> META_USED_NAMES = { const std::vector<std::string> META_USED_NAMES = {
META_ACCESSED, META_ATTRIBUTES, META_BACKUP, META_CHANGED, META_CREATION, META_ACCESSED, META_ATTRIBUTES, META_BACKUP, META_CHANGED,
META_DIRECTORY, META_GID, META_ID, META_KEY, META_MODE, META_CREATION, META_DIRECTORY, META_GID, META_KEY,
META_MODIFIED, META_OSXFLAGS, META_PINNED, META_SIZE, META_SOURCE, META_MODE, META_MODIFIED, META_OSXFLAGS, META_PINNED,
META_UID, META_WRITTEN, META_SIZE, META_SOURCE, META_UID, META_WRITTEN,
}; };
using api_meta_map = std::map<std::string, std::string>; using api_meta_map = std::map<std::string, std::string>;

View File

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

View File

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

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