Skip to content

Commit b3d5325

Browse files
authored
Merge pull request #3089 from darkyshiny/curl-resume-support
Add automatic resume flag when retrying download with curl
2 parents db9afe1 + fe4bec0 commit b3d5325

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

rustup-init.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -607,14 +607,17 @@ check_help_for() {
607607

608608
# Check if curl supports the --retry flag, then pass it to the curl invocation.
609609
check_curl_for_retry_support() {
610-
local _retry_supported=""
611-
# "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
612-
if check_help_for "notspecified" "curl" "--retry"; then
613-
_retry_supported="--retry 3"
614-
fi
615-
616-
RETVAL="$_retry_supported"
610+
local _retry_supported=""
611+
# "unspecified" is for arch, allows for possibility old OS using macports, homebrew, etc.
612+
if check_help_for "notspecified" "curl" "--retry"; then
613+
_retry_supported="--retry 3"
614+
if check_help_for "notspecified" "curl" "--continue-at"; then
615+
# "-C -" tells curl to automatically find where to resume the download when retrying.
616+
_retry_supported="--retry 3 -C -"
617+
fi
618+
fi
617619

620+
RETVAL="$_retry_supported"
618621
}
619622

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

0 commit comments

Comments
 (0)