Open
Description
Package
dio
Version
5.7.0
Operating-System
Windows
Adapter
Default Dio
Output of flutter doctor -v
[√] Flutter (Channel stable, 3.29.0, on Microsoft Windows [版本 10.0.26100.4061], locale zh-CN) [622ms]
• Flutter version 3.29.0 on channel stable at D:\Flutter\Android\flutter-sdk\flutter_windows_3.29.0-stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 35c388afb5 (4 months ago), 2025-02-10 12:48:41 -0800
• Engine revision f73bfc4522
• Dart version 3.7.0
• DevTools version 2.42.2
[√] Windows Version (Windows 11 or higher, 24H2, 2009) [2.9s]
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [3.8s]
• Android SDK at D:\Flutter\Android\android-sdk
• Platform android-36, build-tools 35.0.1
• ANDROID_HOME = D:\Flutter\Android\android-sdk
• Java binary at: D:\Flutter\Android\android-studio-narwhal-canary10\jbr\bin\java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
• All Android licenses accepted.
[√] Chrome - develop for the web [171ms]
• Chrome at C:\Users\Flutter\AppData\Local\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.13.7) [170ms]
• Visual Studio at D:\Flutter\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.13.36105.23
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2024.3.2) [29ms]
• Android Studio at D:\Flutter\Android\android-studio-meerkat-feature-drop-canary3
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
[√] Android Studio (version 2025.1.1) [27ms]
• Android Studio at D:\Flutter\Android\android-studio-narwhal-canary10
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.6+-13391695-b895.109)
[√] Connected device (3 available) [197ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.26100.4061]
• Chrome (web) • chrome • web-javascript • Google Chrome 136.0.7103.93
• Edge (web) • edge • web-javascript • Microsoft Edge 136.0.3240.92
[√] Network resources [607ms]
• All expected network resources are available.
• No issues found!
Dart Version
3.7.0
Steps to Reproduce
首先,感谢杜文及CFUG各位成员的贡献。
我看这个Bug出现了很长时间,但是都没有得到解决,期望这个问题得到解决。
我查看了已有Issues,也没看到好的解决方案
https://github.com/cfug/dio/issues?q=is%3Aissue%20state%3Aclosed%20HttpException%3A%20Connection%20closed%20before%20full%20header%20was%20received
重现场景:我的应用类似应用宝多任务下载文件,同时执行多个下载任务时,会出现这个报错:HttpException: Connection closed before full header was received,从而导致下载失败。
我这打印出来的报错是这样:DioExceptionType.unknown HttpException: Connection closed before full header was received
Expected Result
正常下载,不会报错导致下载失败
Actual Result
报错:HttpException: Connection closed before full header was received,然后下载失败