net/socket.hpp | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
New commits:
commit cbfa42e24828a16eabf605c973cbe357be355c95
Author: Ashod Nakashian <[email protected]>
Date: Sun Feb 19 23:22:39 2017 -0500
nb: properly shutdown and cleanup SSL
Change-Id: Idd39851775e16c62d6192e08c9058cd9fb40104f
Reviewed-on: https://gerrit.libreoffice.org/34454
Reviewed-by: Ashod Nakashian <[email protected]>
Tested-by: Ashod Nakashian <[email protected]>
diff --git a/net/socket.hpp b/net/socket.hpp
index 3119834..25a335c 100644
--- a/net/socket.hpp
+++ b/net/socket.hpp
@@ -431,6 +431,22 @@ protected:
class SslStreamSocket : public BufferingSocket
{
public:
+ ~SslStreamSocket()
+ {
+ shutdown();
+ SSL_free(_ssl);
+ }
+
+ /// Shutdown the TLS/SSL connection properly.
+ void shutdown()
+ {
+ if (SSL_shutdown(_ssl) == 0)
+ {
+ // Complete the bidirectional shutdown.
+ SSL_shutdown(_ssl);
+ }
+ }
+
bool readIncomingData() override
{
const int rc = doHandshake();
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits