Skip to content

Commit

Permalink
Merge pull request #3089 from darkyshiny/curl-resume-support
Browse files Browse the repository at this point in the history
Add automatic resume flag when retrying download with curl
  • Loading branch information
Rustin170506 authored Oct 27, 2022
2 parents db9afe1 + fe4bec0 commit b3d5325
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,17 @@ check_help_for() {

# Check if curl supports the --retry flag, then pass it to the curl invocation.
check_curl_for_retry_support() {
local _retry_supported=""
# "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
if check_help_for "notspecified" "curl" "--retry"; then
_retry_supported="--retry 3"
fi

RETVAL="$_retry_supported"
local _retry_supported=""
# "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
if check_help_for "notspecified" "curl" "--retry"; then
_retry_supported="--retry 3"
if check_help_for "notspecified" "curl" "--continue-at"; then
# "-C -" tells curl to automatically find where to resume the download when retrying.
_retry_supported="--retry 3 -C -"
fi
fi

RETVAL="$_retry_supported"
}

# Return cipher suite string specified by user, otherwise return strong TLS 1.2-1.3 cipher suites
Expand Down

0 comments on commit b3d5325

Please sign in to comment.