From 6bf3ccb7b5cc879c693f5bdb39386085589d996f Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 16 Apr 2019 19:37:42 -0700 Subject: [PATCH] ircd::net: Bypass call to current_cipher() on error conditions. --- ircd/net.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ircd/net.cc b/ircd/net.cc index 8310baff1..e4134225a 100644 --- a/ircd/net.cc +++ b/ircd/net.cc @@ -1762,9 +1762,11 @@ noexcept try assert(bool(sock)); #ifdef RB_DEBUG - const auto ¤t_cipher + const auto *const current_cipher { - openssl::current_cipher(*sock) + !ec? + openssl::current_cipher(*sock): + nullptr }; thread_local char ecbuf[64]; @@ -3222,9 +3224,11 @@ noexcept try ec = make_error_code(errc::timed_out); #ifdef RB_DEBUG - const auto ¤t_cipher + const auto *const current_cipher { - openssl::current_cipher(*this) + !ec? + openssl::current_cipher(*this): + nullptr }; thread_local char ecbuf[64];