Repository navigation
Free the TLS connection state on close - #263
Conversation
An injected TLS module backed by a C library holds one SSL object per connection, but nothing ever tore tls_conn down. Server and client Connection.deinit now call tls.Connection.deinit when the module declares it; tls.zig does not, so nothing changes for the bundled module.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
lalinsky
left a comment
There was a problem hiding this comment.
Never occurred to me to use the tls.zig API as an interface, but it kind of makes sense. I'll see if I can upstream the deinit() method so we can get rid of the hasDecl later on.
With
use_bundled_tls = falsean application can inject its owntlsmodule. I'm injecting one backed by BoringSSL, which holds oneSSLobject (and its BIO) per connection, and nothing in dusty ever tearstls_conndown, so every connection leaked itsSSL.Server and client
Connection.deinitnow calltls.Connection.deinitwhen the module declares it. tls.zig'sConnectionowns no memory and has nodeinit, so the@hasDeclcheck keeps the bundled module exactly as it was.tls_connis set to null afterwards in both.No test here: with the bundled tls.zig there is nothing to observe. The BoringSSL module's own tests (24k handshakes, flat RSS,
leaksclean) are what caught it.