Skip to content

Commit 1ccddd1

Browse files
authored
SSL_shutdown() only if not already closed by remote (#413)
1 parent 992f3dc commit 1ccddd1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

httplib.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4467,7 +4467,9 @@ inline bool process_and_close_socket_ssl(
44674467
}
44684468
}
44694469

4470-
SSL_shutdown(ssl);
4470+
if (ret) {
4471+
SSL_shutdown(ssl); // shutdown only if not already closed by remote
4472+
}
44714473
{
44724474
std::lock_guard<std::mutex> guard(ctx_mutex);
44734475
SSL_free(ssl);

0 commit comments

Comments
 (0)