Commit b024c08
fix: Handle race condition when close_reason() returns None
The functions `no_connect()` and `with_no_connection()` previously
used `.expect()` on `quic_connection.close_reason()`, which panics
when the connection is still alive.
This race condition occurs when:
1. A QUIC connection is established to an HTTP/3 server
2. Server sends SETTINGS frame quickly (e.g., Akamai)
3. Driver thread processes incoming streams
4. Connection cleanup is triggered simultaneously
5. close_reason() returns None (connection still alive)
6. .expect() panics: "QUIC connection is still alive on close-cast"
The fix replaces .expect() with match expressions that gracefully
return ConnectionError::LocallyClosed when close_reason() is None.
Affected: HTTP/3 client applications scanning sites protected by
Akamai and similar CDNs with fast SETTINGS responses.1 parent 0c49c18 commit b024c08
1 file changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
| |||
0 commit comments