abraunegg-onedrive/src/curlEngine.d

110 lines
4.5 KiB
D
Raw Normal View History

Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
// What is this module called?
module curlEngine;
// What does this module require to function?
import std.net.curl;
import etc.c.curl: CurlOption;
import std.datetime;
import std.conv;
import std.stdio;
Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
// What other modules that we have created do we need to import?
import log;
class CurlEngine {
HTTP http;
bool keepAlive;
ulong dnsTimeout;
Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
this() {
http = HTTP();
}
void initialise(ulong dnsTimeout, ulong connectTimeout, ulong dataTimeout, ulong operationTimeout, int maxRedirects, bool httpsDebug, string userAgent, bool httpProtocol, ulong userRateLimit, ulong protocolVersion, bool keepAlive=false) {
// Setting this to false ensures that when we close the curl instance, any open sockets are closed - which we need to do when running
// multiple threads and API instances at the same time otherwise we run out of local files | sockets pretty quickly
this.keepAlive = keepAlive;
this.dnsTimeout = dnsTimeout;
Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
// Curl Timeout Handling
// libcurl dns_cache_timeout timeout
// https://curl.se/libcurl/c/CURLOPT_DNS_CACHE_TIMEOUT.html
// https://dlang.org/library/std/net/curl/http.dns_timeout.html
http.dnsTimeout = (dur!"seconds"(dnsTimeout));
// Timeout for HTTPS connections
// https://curl.se/libcurl/c/CURLOPT_CONNECTTIMEOUT.html
// https://dlang.org/library/std/net/curl/http.connect_timeout.html
http.connectTimeout = (dur!"seconds"(connectTimeout));
// Timeout for activity on connection
// This is a DMD | DLANG specific item, not a libcurl item
// https://dlang.org/library/std/net/curl/http.data_timeout.html
// https://raw.githubusercontent.com/dlang/phobos/master/std/net/curl.d - private enum _defaultDataTimeout = dur!"minutes"(2);
http.dataTimeout = (dur!"seconds"(dataTimeout));
// Maximum time any operation is allowed to take
// This includes dns resolution, connecting, data transfer, etc.
// https://curl.se/libcurl/c/CURLOPT_TIMEOUT_MS.html
// https://dlang.org/library/std/net/curl/http.operation_timeout.html
http.operationTimeout = (dur!"seconds"(operationTimeout));
// Specify how many redirects should be allowed
http.maxRedirects(maxRedirects);
// Debug HTTPS
http.verbose = httpsDebug;
// Use the configured 'user_agent' value
http.setUserAgent = userAgent;
// What IP protocol version should be used when using Curl - IPv4 & IPv6, IPv4 or IPv6
http.handle.set(CurlOption.ipresolve,protocolVersion); // 0 = IPv4 + IPv6, 1 = IPv4 Only, 2 = IPv6 Only
// What version of HTTP protocol do we use?
// Curl >= 7.62.0 defaults to http2 for a significant number of operations
if (httpProtocol) {
// Downgrade to HTTP 1.1 - yes version = 2 is HTTP 1.1
http.handle.set(CurlOption.http_version,2);
}
// Configure upload / download rate limits if configured
// 131072 = 128 KB/s - minimum for basic application operations to prevent timeouts
// A 0 value means rate is unlimited, and is the curl default
if (userRateLimit > 0) {
// set rate limit
http.handle.set(CurlOption.max_send_speed_large,userRateLimit);
http.handle.set(CurlOption.max_recv_speed_large,userRateLimit);
}
// Explicitly set these libcurl options
// https://curl.se/libcurl/c/CURLOPT_NOSIGNAL.html
// Ensure that nosignal is set to 0 - Setting CURLOPT_NOSIGNAL to 0 makes libcurl ask the system to ignore SIGPIPE signals
http.handle.set(CurlOption.nosignal,0);
// https://curl.se/libcurl/c/CURLOPT_TCP_NODELAY.html
// Ensure that TCP_NODELAY is set to 0 to ensure that TCP NAGLE is enabled
http.handle.set(CurlOption.tcp_nodelay,0);
if (httpsDebug) {
// Output what options we are using so that in the debug log this can be tracked
addLogEntry("http.dnsTimeout = " ~ to!string(dnsTimeout), ["debug"]);
addLogEntry("http.connectTimeout = " ~ to!string(connectTimeout), ["debug"]);
addLogEntry("http.dataTimeout = " ~ to!string(dataTimeout), ["debug"]);
addLogEntry("http.operationTimeout = " ~ to!string(operationTimeout), ["debug"]);
addLogEntry("http.maxRedirects = " ~ to!string(maxRedirects), ["debug"]);
addLogEntry("http.CurlOption.ipresolve = " ~ to!string(protocolVersion), ["debug"]);
addLogEntry("http.header.Connection.keepAlive = " ~ to!string(keepAlive), ["debug"]);
Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
}
}
void connect(HTTP.Method method, const(char)[] url) {
if (!keepAlive)
http.addRequestHeader("Connection", "close");
http.method = method;
http.url = url;
Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
}
void setDisableSSLVerifyPeer() {
addLogEntry("CAUTION: Switching off CurlOption.ssl_verifypeer ... this makes the application insecure.", ["debug"]);
Squashed commit of the following: commit 1eff2d7d673a7e058ba9467f4da315237b47392e Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 19:15:27 2023 +1100 Update PR * Add --source-directory 'path/as/source/' --destination-directory 'path/as/destination' functionality commit ad3ddee0ec86ad70be4c939d9bcc44773819ec2d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 17:32:24 2023 +1100 Update PR * Add --create-directory * Add --remove-directory commit 7dfe6b65b7a6d88e72094685f0c968441097c921 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 12:27:03 2023 +1100 Update PR * Update PR commit 75c071e56f3493c53c6c41753f2c36e761057d45 Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 18 10:12:05 2023 +1100 Update PR * Update PR commit 6db484cdad332e9b351e1fef7d59080637c195f9 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 16 17:01:25 2023 +1100 Update PR * Update PR commit d893ea54604b0a0e27c722a761686cfb5086bc3b Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 10:43:50 2023 +1100 Update PR * Update PR commit 82bd593bf4daf183a3e900e444a4725d8913da9d Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 09:14:17 2023 +1100 Update PR * Validate and document --auth-files operation commit c551203f4c2bf0de8254015da107f53cc0936aae Author: abraunegg <alex.braunegg@gmail.com> Date: Wed Oct 11 05:48:22 2023 +1100 Update PR * Add --create-share-link commit fbf63999ff31086ab62faec9dcdcf271e046d957 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 18:39:21 2023 +1100 Update PR * Update PR commit 72a46800350ad970e3a4e61df2305000510a0354 Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 17:43:15 2023 +1100 Update PR * Add --get-file-link * Add --modified-by commit 0d3fc3ebf23c85fb0c8e43fe84d9aff68115552a Author: abraunegg <alex.braunegg@gmail.com> Date: Tue Oct 10 14:28:10 2023 +1100 Add --display-sync-status * Add --display-sync-status commit 1f183ca03ec96aef1fa895e24f0ae256a0a53d84 Author: abraunegg <alex.braunegg@gmail.com> Date: Mon Oct 9 08:18:13 2023 +1100 Update PR * Update PR with doc updates commit b0628d709921cca820dc6a7179a27756c82710e4 Author: abraunegg <alex.braunegg@gmail.com> Date: Sun Oct 8 10:52:52 2023 +1100 Update PR * Update PR commit 7e3df956ce489646dfad5e87af8d33d93de974d7 Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:31:26 2023 +1100 Update PR * Update PR commit c69f2abc4b5e570b315b277cbd7beb8eae5a7bbf Author: abraunegg <alex.braunegg@gmail.com> Date: Sat Oct 7 05:28:28 2023 +1100 Update PR * Update PR commit ea1ca333741520ae66d413acf92a71d78eebd32d Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 14:57:51 2023 +1100 Update PR * Update PR commit 1503f969dfa6c8c008f3ccd8bd1cc203bd12e7ee Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 09:19:04 2023 +1100 Update PR * Update PR commit 5127464f2c08942b864b23691e56d73fe9cb9e16 Author: abraunegg <alex.braunegg@gmail.com> Date: Fri Oct 6 06:48:20 2023 +1100 Change when the integrity check is performed * Change when the integrity check is performed commit c7cc45d95c14801d8f616c4a04e0fb030c4e5b02 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 19:40:05 2023 +1100 Update maxInotifyWatches location * Update maxInotifyWatches location commit c44ad963a6e7d2d80eeee7ef82a3ab53d6448486 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:41:31 2023 +1100 Update main.d * Fix --version segfault commit 51f0ffcb1f6a5ae80a1ecb65e4dda9efc2db4f94 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:24:30 2023 +1100 Uplift to v2.5.0-alpha-2 * Uplift to v2.5.0-alpha-2 commit cbe3e6ea845dfe17b909141b2c87fbfae8086669 Author: abraunegg <alex.braunegg@gmail.com> Date: Thu Oct 5 17:17:26 2023 +1100 Clean up before onedrive-v2.5.0-alpha-2 * Clean up before onedrive-v2.5.0-alpha-2
2023-10-18 20:31:50 +02:00
http.handle.set(CurlOption.ssl_verifypeer, 0);
}
}