From 79c5210d07853bbed3d517fb02fef619d98003d3 Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 6 Aug 2024 10:51:57 -0400 Subject: [PATCH] Make shutdown action more stable --- httplib.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/httplib.h b/httplib.h index 237129a..3aa1be1 100644 --- a/httplib.h +++ b/httplib.h @@ -8559,6 +8559,8 @@ inline void ssl_delete(std::mutex &ctx_mutex, SSL *ssl, socket_t sock, setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast(&tv), sizeof(tv)); + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + char buf[1]; if (SSL_peek(ssl, buf, 1) == 0 && SSL_get_error(ssl, 0) == SSL_ERROR_ZERO_RETURN) {