Commit fa88d15
committed
Make sure UniquePtrs get destructed after MsQuicRegistration
We were failing one of the DataTests due to the Client/Server secrets
getting destroyed before the underlying TLS structure was done with
them.
This was occuring because in QuicTestConnectAndPing, the test function
returns before the openssl TLS layer had completing registering the
server side application read key, which isn't needed for the reporting
of an established connection. The function returned, cleaned the
secrets buffer, after which the TLS layer tried to access them, and
boom.
Thanks to @guhetier, who noted that the destruction of the
MsQuicRegistration forces shutdown of the connection, and blocks on its
completion, so if we move the declaration of the UniquePtr buffers to
before the allocation of said registration, the fact that C++ calls
destructors in reverse order ensures that the Secrets memory remains
valid until the connection is shut down.1 parent 7c82ab4 commit fa88d15
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
422 | 425 | | |
423 | 426 | | |
424 | 427 | | |
| |||
428 | 431 | | |
429 | 432 | | |
430 | 433 | | |
431 | | - | |
432 | | - | |
433 | 434 | | |
434 | 435 | | |
435 | 436 | | |
| |||
0 commit comments