Commit aa3a7f1
committed
Report connection errors on streams as HTTP/3 errors
Motivation:
When the peer closes the connection, SwiftNetwork delivers the
CONNECTION_CLOSE to every stream flow, so each stream's pipeline sees a
'QUICConnectionError' before the connection's pipeline does. The
coordinator's own fan-out ('cancelStreamsDueToConnectionClose') can't
reach those streams because they have already closed and deregistered by
the time it runs.
'HTTP3StreamHandler' passed the error through untouched, so the owner of
a request stream saw a QUIC error rather than an HTTP/3 one. It already
translates the other two peer-close errors, RESET_STREAM and
STOP_SENDING; CONNECTION_CLOSE was the missing third.
Modifications:
- Translate 'QUICConnectionError' into an 'HTTP3Error' with code
'remoteConnectionError' in 'HTTP3StreamHandler.errorCaught', keeping
the peer's reason phrase and, for application errors, its error code.
Result:
Streams report HTTP/3 errors when the connection is closed by the peer1 parent 393bc4f commit aa3a7f1
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
305 | 319 | | |
306 | 320 | | |
307 | 321 | | |
| |||
0 commit comments