From f09b261b6241f66ea364e928ae20a5f19dcbc4a3 Mon Sep 17 00:00:00 2001 From: Nicholas Orlowsky Date: Thu, 20 Feb 2025 13:48:30 -0500 Subject: [PATCH] ssl fix --- lib/anthracite.cpp | 5 +++-- shell.nix | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/anthracite.cpp b/lib/anthracite.cpp index d10cacb..f1cf31c 100644 --- a/lib/anthracite.cpp +++ b/lib/anthracite.cpp @@ -89,12 +89,13 @@ int listen_loop(int port_number, backends::backend& be, bool tls) { socket::anthracite_socket* client_sock; if (tls){ - client_sock = new socket::openssl_socket(*dynamic_cast(socket)); + socket::openssl_socket* ssl_sock = dynamic_cast(socket); + client_sock = new socket::openssl_socket(*ssl_sock); } else { client_sock = new socket::anthracite_socket(*socket); } - std::thread(handle_client, socket, std::ref(be), std::ref(fb), std::ref(thread_wait_mutex), std::ref(thread_wait_condvar), std::ref(active_threads)).detach(); + std::thread(handle_client, client_sock, std::ref(be), std::ref(fb), std::ref(thread_wait_mutex), std::ref(thread_wait_condvar), std::ref(active_threads)).detach(); } delete socket; diff --git a/shell.nix b/shell.nix index e9a5a69..201b9ef 100644 --- a/shell.nix +++ b/shell.nix @@ -6,6 +6,6 @@ export OPENSSL_DIR="${pkgs.openssl.dev}" export PKG_CONFIG_PATH="${pkgs.openssl.dev}/lib/pkgconfig" export OPENSSL_NO_VENDOR=1 -export OPENSSL_LIB_DIR="${pkgs.lib.getLib pkgs.openssl}/lib" + export OPENSSL_LIB_DIR="${pkgs.lib.getLib pkgs.openssl}/lib" ''; }