test-crypto: Don't put TLSv12 in an OwnPtr as it's ref-counted :)

This commit is contained in:
Andreas Kling 2020-05-18 20:15:56 +02:00
parent 42651200d4
commit 9eaf22090f
Notes: sideshowbarker 2024-07-19 06:29:13 +09:00

View File

@ -144,10 +144,10 @@ int run(Function<void(const char*, size_t)> fn)
void tls(const char* message, size_t len)
{
static OwnPtr<TLS::TLSv12> tls;
static RefPtr<TLS::TLSv12> tls;
static ByteBuffer write {};
if (!tls) {
tls = make<TLS::TLSv12>(nullptr);
tls = TLS::TLSv12::construct(nullptr);
tls->connect(server ?: DEFAULT_SERVER, port);
tls->on_tls_ready_to_read = [](auto& tls) {
auto buffer = tls.read();