Closed heartsucker closed 2 months ago
Note: We should ask our pilot users about any difficulties downloading large files to inform prioritization of this issue.
[Backlog pruning, 5/16] We explicitly decided that the only network level changes for that we wanted to make for MVP had to do with supporting larger sets of sources + some level of networking monitor. This would be a great improvement but it post MVP.
proxy v2 supports range requests by just passing the headers through like any other header, and streaming the bytes back. The range support is really implemented in the client/sdk, which happened in https://github.com/freedomofpress/securedrop-client/pull/2006.
Related issue in SecureDrop core: https://github.com/freedomofpress/securedrop/issues/3907
Because Tor is slow and flaky, and because long downloads are slow. We may want to support range requests to allow partial downloads to resume. The behavior would be to download file to a special, permission protected directory in
/tmp
so they are cleaned up on reboots. When a download would start, the proxy application would check for the presence of the file and then send the appropriate range header to pickup where the last process left off.We would also need to guard against multiple simultaneous downloads, possibly using some sort of
fcntl
exclusive lock to prevent race conditions with one process finishing and then another process appending before the file move happens.