mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-14 16:58:30 +00:00
Use SSL_ERROR_ZERO_RETURN to check if the SSL peer is closed.
This commit is contained in:
parent
7b69999c37
commit
1ebb8412c5
1 changed files with 2 additions and 1 deletions
|
@ -6765,7 +6765,8 @@ inline bool ClientImpl::process_request(Stream &strm, Request &req,
|
|||
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
|
||||
if (is_ssl()) {
|
||||
char buf[1];
|
||||
if (SSL_peek(socket_.ssl, buf, 1) == 0) {
|
||||
if (SSL_peek(socket_.ssl, buf, 1) == 0 &&
|
||||
SSL_get_error(socket_.ssl, 0) == SSL_ERROR_ZERO_RETURN) {
|
||||
error = Error::SSLPeerCouldBeClosed_;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue