Browse Source

Explicitly set libcurl options (#1789)

* Explicitly set libcurl options to ignore SIGPIPE, use TCP NAGLE and ensure we are re-using connections. These should be 'enabled by default' by libcurl, but we need to ensure we are setting them to their supposed default

Potentially resolves the following issues: #494, #753, #792, #884, #1162, #1408, #1520, #1526 + others.
pull/1799/head
abraunegg 1 week ago
committed by GitHub
parent
commit
f72f6c9262
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/onedrive.d

11
src/onedrive.d

@ -455,6 +455,17 @@ final class OneDriveApi
http.handle.set(CurlOption.max_recv_speed_large,userRateLimit);
}
// Explicitly set 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);
// https://curl.se/libcurl/c/CURLOPT_FORBID_REUSE.html
// Ensure that we ARE reusing connections - setting to 0 ensures that we are reusing connections
http.handle.set(CurlOption.forbid_reuse,0);
// Do we set the dryRun handlers?
if (cfg.getValueBool("dry_run")) {
.dryRun = true;

Loading…
Cancel
Save