From 3e86bdb4d81c6457665beb6469f4d907019268b2 Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 3 Dec 2024 00:11:29 -0500 Subject: [PATCH] Fix #1997 (#2001) --- httplib.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/httplib.h b/httplib.h index e25fa2a..f7e54d2 100644 --- a/httplib.h +++ b/httplib.h @@ -7438,7 +7438,9 @@ inline bool ClientImpl::send_(Request &req, Response &res, Error &error) { #ifdef CPPHTTPLIB_OPENSSL_SUPPORT if (is_alive && is_ssl()) { + detail::set_nonblocking(socket_.sock, true); if (is_ssl_peer_could_be_closed(socket_.ssl)) { is_alive = false; } + detail::set_nonblocking(socket_.sock, false); } #endif