Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When sharing a large file with --local-only, the download quickly stalls #870

Open
micahflee opened this Issue Jan 20, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@micahflee
Copy link
Owner

micahflee commented Jan 20, 2019

While implementing #868 I found a very strange, and reproducible, bug. I'm sharing a 352mb file, large_file.img, I had laying around, and I start sharing it like this:

./dev_scripts/onionshare --local-only --debug ~/tmp/large_file.img

Since it's --local-only, I get a URL like http://127.0.0.1:17615/overtone-risk. When I start downloading it in a browser, it occasionally works, but most of the time it fails just after 3% of the download. Only instead of failing, it just stalls.

After some debugging, I think it's happening in onionshare/web/share_mode.py, in ShareModeWeb.define_routes(), in download_logic(), in generate(). The generator is supposed to load a file, read a chunk of it at a time, and yield a chunk. But it looks like it's stalling on this line:

yield chunk

It simply never runs the following lines of code, and in the browser the download is active but says "Unknown time left -- 0 bytes (0 bytes/sec)".

I can reproduce nearly every time (but occasionally it works and downloads all the way).

When I do this same thing, but without --local-only and when using Tor Browser, it always works, and I can't reproduce the problem.

@micahflee micahflee added the bug label Jan 20, 2019

@farhaanbukhsh

This comment has been minimized.

Copy link

farhaanbukhsh commented Jan 29, 2019

Hey @micahflee I would like to give this bug a try and contribute to onionshare.

@micahflee

This comment has been minimized.

Copy link
Owner Author

micahflee commented Mar 26, 2019

Hey @farhaanbukhsh I'd be happy for you to contribute and fix this bug! You can go ahead and try to understand what's broken and post comments here, and make a pull request when you think you have a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.