Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[XrdTpc] Only use Curl's low-speed-limit with libcurl v7.38 and later #941

Merged
merged 1 commit into from
Mar 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/XrdTpc/XrdTpcState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,15 @@ bool State::InstallHandlers(CURL *curl) {
}
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);

// Require a minimum speed from the transfer: must move at least 1MB every 2 minutes
// (roughly 8KB/s).
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 2*60);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024*1024);
// Only use low-speed limits with libcurl v7.38 or later.
// Older versions have poor transfer performance, corrected in curl commit cacdc27f.
curl_version_info_data *curl_ver = curl_version_info(CURLVERSION_NOW);
if (curl_ver->age > 0 && curl_ver->version_num >= 0x072600) {
// Require a minimum speed from the transfer: must move at least 1MB every 2 minutes
// (roughly 8KB/s).
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 2*60);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1024*1024);
}
return true;
}

Expand Down