mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
curl_download
: Retry once on error 33
.
This commit is contained in:
parent
67b20d97d8
commit
fd477365b5
@ -38,7 +38,16 @@ def curl(*args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
def curl_download(*args, to: nil, **options)
|
def curl_download(*args, to: nil, **options)
|
||||||
curl("--location", "--remote-time", "--continue-at", "-", "--output", to, *args, **options)
|
continue_at ||= "-"
|
||||||
|
curl("--location", "--remote-time", "--continue-at", continue_at, "--output", to, *args, **options)
|
||||||
|
rescue ErrorDuringExecution
|
||||||
|
# `curl` error 33: HTTP server doesn't seem to support byte ranges. Cannot resume.
|
||||||
|
if $CHILD_STATUS.exitstatus == 33 && continue_at == "-"
|
||||||
|
continue_at = "0"
|
||||||
|
retry
|
||||||
|
end
|
||||||
|
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
|
|
||||||
def curl_output(*args, **options)
|
def curl_output(*args, **options)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user