Skip to content

fix: don't let the default timeout kill streamed downloads - #28

Merged
klobucar merged 2 commits into
mainfrom
fix/streaming-timeout
Jun 11, 2026
Merged

fix: don't let the default timeout kill streamed downloads#28
klobucar merged 2 commits into
mainfrom
fix/streaming-timeout

Conversation

@klobucar

Copy link
Copy Markdown
Owner

http.Client.Timeout covers reading the entire response body, so a streamed transfer (-o FILE or piped stdout, both via BodySink) was killed at the 30s default mid-download — defeating the point of the streaming path, which exists for arbitrarily large bodies.

Do() now executes BodySink requests on a second client whose transport bounds the wait for response headers (ResponseHeaderTimeout) instead of the whole transfer, cloned from the default transport so the 30s dial timeout still applies. An explicit --timeout remains a total cap, also for streams: runCLI/runTUI now set it via Client.SetTimeout, which records that the user asked for one. Buffered requests are unchanged.

klobucar added 2 commits June 10, 2026 12:00
http.Client.Timeout covers reading the entire response body, so a
streamed transfer (-o FILE or piped stdout, both via BodySink) was
killed at the 30s default mid-download — defeating the point of the
streaming path, which exists for arbitrarily large bodies.

Do() now executes BodySink requests on a second client whose transport
bounds the wait for response headers (ResponseHeaderTimeout) instead of
the whole transfer, cloned from the default transport so the 30s dial
timeout still applies. An explicit --timeout remains a total cap, also
for streams: runCLI/runTUI now set it via Client.SetTimeout, which
records that the user asked for one. Buffered requests are unchanged.
@klobucar
klobucar merged commit b722a52 into main Jun 11, 2026
8 checks passed
@klobucar
klobucar deleted the fix/streaming-timeout branch June 11, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant