Commit fe51447
Fix DownloadManager timeout kwarg compatibility with desktop aiohttp (#107)
* Fix DownloadManager timeout kwarg compatibility with desktop aiohttp
The desktop aiohttp implementation doesn't support the timeout
keyword argument added in #98. Fall back to calling session.get()
without timeout when TypeError is raised, so downloads work on
both ESP32 (with timeout) and desktop (without).
Fixes test_custom_headers and test_json_download failures on
desktop builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
* Add connection timeout support to aiohttp and restore in DownloadManager
The MicroPython aiohttp library had no timeout support (marked as TODO).
Add a timeout parameter to request_raw(), _request(), and request()
that wraps asyncio.open_connection() with asyncio.wait_for().
This allows DownloadManager to use session.get(timeout=...) to prevent
connections from hanging indefinitely on stalled TCP/TLS handshakes,
which was the original fix in #98.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
---------
Co-authored-by: Richard Taylor <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>1 parent e91e7f4 commit fe51447
1 file changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
197 | 203 | | |
198 | 204 | | |
199 | 205 | | |
| |||
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
235 | | - | |
| 241 | + | |
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
| |||
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
| 252 | + | |
246 | 253 | | |
247 | 254 | | |
248 | 255 | | |
| |||
0 commit comments