Make shutdown action more stable

This commit is contained in:
yhirose 2024-08-06 10:51:57 -04:00
parent 1ab08eac4e
commit 79c5210d07

View File

@ -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<const void *>(&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) {