-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Download receiveTimeout #2022
Comments
You should be able to set it to |
I have tried to set it to 'null', but it defaults to using the 'receiveTimeout' of the option for the single instance 'dio', so my current method can only set it to a relatively large time |
Oh, right so you can not override it in the Do I understand this correctly? |
Yes, Unless a new |
So the most straight-forward solution would be to ignore zero duration? @ueman |
Yea I agree |
Resolves #2022. ### New Pull Request Checklist - [x] I have read the [Documentation](https://pub.dev/documentation/dio/latest/) - [x] I have searched for a similar pull request in the [project](https://github.com/cfug/dio/pulls) and found none - [x] I have updated this branch with the latest `main` branch to avoid conflicts (via merge from master or rebase) - [x] I have added the required tests to prove the fix/feature I'm adding - [x] I have updated the documentation (if necessary) - [x] I have run the tests without failures - [x] I have updated the `CHANGELOG.md` in the corresponding package ### Additional context and info (if any) I've found that the `IOHttpClientAdapter` uses `Stopwatch` to integrate with `receiveTimeout`, which might cause infinity awaits if the stream has no response forever. This might be the root cause of #1739. https://github.com/cfug/dio/blob/78f3813a8d8948887198ef628e5a2e2039489b03/dio/lib/src/adapters/io_adapter.dart#L194-L200 --------- Signed-off-by: Alex Li <[email protected]>
Package
dio
Version
5.3.3
Operating-System
Android
Output of
flutter doctor -v
Dart Version
No response
Steps to Reproduce
In previous versions, it was only necessary to set the receiveTimeout of the Download Options to 0 to download without timeout. Now, after changing to the Duration type, the time cannot be unlimited
Expected Result
download success
Actual Result
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: DioException [receive timeout]: The request took longer than 0:00:00.000000 to receive data. It was aborted.
The text was updated successfully, but these errors were encountered: