Explorar o código

SSL_shutdown() only if not already closed by remote (#413)

Max %!s(int64=5) %!d(string=hai) anos
pai
achega
1ccddd1b0b
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      httplib.h

+ 3 - 1
httplib.h

@@ -4467,7 +4467,9 @@ inline bool process_and_close_socket_ssl(
     }
   }
 
-  SSL_shutdown(ssl);
+  if (ret) {
+    SSL_shutdown(ssl);		// shutdown only if not already closed by remote
+  }
   {
     std::lock_guard<std::mutex> guard(ctx_mutex);
     SSL_free(ssl);