feat(download): implement single-threaded fallback for non-range servers #146
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/pget!146
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/single-threaded-fallback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Implement proper single-threaded fallback for servers that don't support range requests (HTTP) or REST (FTP). Refactor download path into range-based and full-download code paths.
Why
Without this, servers lacking range support would get Range headers or RetrFrom calls that could fail. Now they get a plain GET/Retr and stream the full response.
Testing
go vet ./...passesgo build ./...passesgolangci-lint run ./...passesBreaking Changes
Internal refactor of download helpers — no public API changes.
Notes
runRangeDownload— existing path for parallel chunked downloads with Range/RetrFromrunFullDownload— new path for single-stream download without byte-range headersio.CopyRetr(notRetrFrom), reads full response viaio.CopyCloses #0060
Closes #0061
Closes #0062
Closes #0063
Review: APPROVED
Verification
go vet ./...— ✅ passesgo build ./...— ✅ passesgolangci-lint v2 run ./...— ✅ 0 issuesChanges
internal/downloader/download.go— Refactored download helpers into range-based (downloadHTTPRange,downloadFTPRange,runRangeDownload) and full-download (downloadHTTPFull,downloadFTPSingle,runFullDownload) code pathsrunWorkerdispatches based onfullDownloadflagDownload()setsfullDownloadwhen server lacks range/REST support or size unknownio.Copy(no Range headers, no size limit)Notes
io.Copyinstead ofio.CopyNwith zero sizeCloses #0060, #0061, #0062, #0063 on merge.