Repository navigation
fix: a stalled transfer gives up; every run's log can be kept whole - #79
Merged
Merged
Conversation
- A download from a phone's FTP server waited until START: Wi-Fi dropped
mid-file, which sends no error, and libcurl had only a connect timeout.
A transfer now gives up after 60 s without a byte (LOW_SPEED_LIMIT/TIME
in Curl::_applyDefaults()); every provider already retries a timeout.
- FTP's retry did not discard what a stalled download had written and
appended the next attempt to the half file; it now rewinds the temp
file and retries on a fresh connection.
- The debug log kept the first 96 KB and the last 48 KB, so a long run
lost the part a report needed. Every run is now written to
/3ds/3DSync/logs/{debug,sync}-<stamp>.log.part as it goes, each line
stripped of colour codes and redacted before it reaches the card, and
renamed to .log when kept or deleted when not. Nothing is held in
memory, and a crash leaves the log up to that point.
- Normal runs offer to keep their log too, with the same question as a
debug run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stalled transfer gives up
A ROM download from a phone's FTP server waited until START. Wi-Fi dropped mid-file, after 118 MB of it had arrived, which sends no error: the connection just goes quiet. libcurl's only limit was the 50 s connect timeout.
CURLOPT_LOW_SPEED_LIMIT/_TIMEinCurl::_applyDefaults(),STALL_SECONDS).CURLE_OPERATION_TIMEDOUT, which every provider already retries. If all three attempts fail, the file is listed as failed and the sync goes on.rewindDownloadFile(), as WebDAV, Dropbox and Drive already did). It also opens a fresh connection for the retry. Before, this only happened on rare network errors; with the timeout it would be the normal case.Every run's log can be kept, in full
/3ds/3DSync/logs/{debug,sync}-<stamp>.log.parton the SD card. Each complete line is stripped of colour codes and passed throughdebugRedact()before it reaches the card, so the file never holds a token, even mid-run..logwhen kept, and deleted when not.offerLogSave(),frontend::askSaveLog()).Tests
make -C tests: 263 pass. Thedebuglogsuite was rewritten:make -C tests previewrenders the prompt after a normal run.Not yet tested
On a console: the timeout and retry after cutting Wi-Fi mid-file, and the saved logs. A test build with steps exists.
🤖 Generated with Claude Code