Commit dc078d0
committed
fix: Emit an error when the stream closes before any response
On Linux, swift-corelibs-foundation (libcurl) terminates a 3xx redirect with an
empty or missing Location header by completing the task with no error and no
response -- no didReceive, no willPerformHTTPRedirection callback. EventSource
treated that as a normal close and reconnected forever, never emitting an error,
so the SSE contract tests "client handles empty/missing Location header with
301/307 status" timed out. (CFNetwork surfaces it as an error, so macOS passed.)
Treat a no-error completion that never opened the stream as an unrecoverable
error and stop, giving deterministic behavior across platforms. Adds a
regression test that finishes a request with no response and asserts an
unrecoverable error with no reconnect.1 parent 0dc0c44 commit dc078d0
2 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
284 | 306 | | |
285 | 307 | | |
286 | 308 | | |
| |||
0 commit comments