Skip to content

Commit

Permalink
core: retry if server doesn't support byte ranges on download [GH-4479]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Nov 20, 2015
1 parent 66c99dd commit e0ef592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ BUG FIXES:
- core: don't check for metadata if the download URL is not HTTP [GH-6540]
- core: don't make custom dotfile path if there is no Vagrantfile [GH-6542]
- core: more robust check for admin privs on Windows [GH-5616]
- core: properly detect when HTTP server doesn't support byte ranges and
retry from scratch [GH-4479]
- commands/box: removing all versions and providers of a box will properly
clean all directories in `~/.vagrant.d/boxes` [GH-3570]
- commands/rdp: prefer `xfreerdp` if it is available on Linux [GH-6475]
Expand Down
5 changes: 4 additions & 1 deletion lib/vagrant/util/downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ def download!
# If we already retried, raise it.
raise if retried

@logger.error("Exit code: #{e.extra_data[:code]}")

# If its any error other than 33, it is an error.
raise if e.extra_data[:exit_code].to_i != 33
raise if e.extra_data[:code].to_i != 33

# Exit code 33 means that the server doesn't support ranges.
# In this case, try again without resume.
@logger.error("Error is server doesn't support byte ranges. Retrying from scratch.")
@continue = false
retried = true
retry
Expand Down

0 comments on commit e0ef592

Please sign in to comment.