Commit a751da1
Guard unset ingress source during CONNECT teardown
Summary:
HTTPConnectStream constructs the transport before awaiting sendRequest(), but ingressSource_ is assigned only after that await completes. If CONNECT setup is cancelled or throws first, destruction calls close() -> shutdownRead() -> canRead() and dereferences the unset shared_ptr.
Guard ingressSource_ in canRead() so partially constructed streams report that they are not readable. Apply the change to both the fbcode and xplat mirrors.
Keep the existing ConnectCancelledBeforeIngressAssigned regression test. It reproduces the production destructor stack without the guard and passes once the guard is present.
This fixes the recurring crash tracked by T277272947, T283037317, and T284870008.
Reviewed By: jbeshay
Differential Revision: D114422937
fbshipit-source-id: e064f038a3034a51f8c220b61a207d9c90fdb9f31 parent 9b8c221 commit a751da1
2 files changed
Lines changed: 20 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
292 | 311 | | |
293 | 312 | | |
294 | 313 | | |
| |||
0 commit comments