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

Error: Unexpected EOF when reading chunked response body #11

Open
sogko opened this issue Aug 11, 2015 · 0 comments
Open

Error: Unexpected EOF when reading chunked response body #11

sogko opened this issue Aug 11, 2015 · 0 comments

Comments

@sogko
Copy link
Contributor

sogko commented Aug 11, 2015

Hi,

I've been trying to use the library to download files off a MEGA account and when I was trying with smaller files it worked great. But when I started to download larger files (>100mb) it started to return unexpected EOF errors for at least one of the chunks (random chunks on every run).

This behaviour exhibit itself even when I tried different number of download workers (1, default 3, 5 etc)

I couldn't pinpoint exactly why but probably the server closed its connection abruptly, causing the response body to return an error when reading it (could be malformed? but somehow still returning 200 OK status. weird)

The error comes from line 711, ioutil.ReadAll

I've written a workaround that simply retries when ioutil failed to read the body and it fixes the issue. Will create a PR soon.

sogko added a commit to sogko/go-mega that referenced this issue Aug 11, 2015
…ody)

- Simply try to read the response body as bytes[] and retry again if ioutil
returns an error
- Also, sleep for 5 seconds before retrying, to allow server to recover.
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

No branches or pull requests

2 participants
@sogko and others