summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls/openssl/qtls_openssl.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-07-12 11:28:19 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-07-16 23:41:34 +0200
commit9cc0c64e0857ded99e5031548ae9b7fc8107caf8 (patch)
tree81c7f460b8ef07c654de3215dc1e3d68a912be72 /src/plugins/tls/openssl/qtls_openssl.cpp
parent2915921ad2a79a4ce1651dc7297f6571788d1413 (diff)
SSL: port QSharedPointer<QSslContext> uses to std-compatible API subset
In preparation of porting to shared_ptr. Add a few strategic moves and remove a rather pointless comment stating the obvious. Change-Id: Ie1c0f3431af79bdb204e00d99323bf9f2d100d0d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/tls/openssl/qtls_openssl.cpp')
-rw-r--r--src/plugins/tls/openssl/qtls_openssl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/tls/openssl/qtls_openssl.cpp b/src/plugins/tls/openssl/qtls_openssl.cpp
index dbbd9b29a8..ec4303bcdc 100644
--- a/src/plugins/tls/openssl/qtls_openssl.cpp
+++ b/src/plugins/tls/openssl/qtls_openssl.cpp
@@ -506,8 +506,8 @@ void TlsCryptographOpenSSL::init(QSslSocket *qObj, QSslSocketPrivate *dObj)
void TlsCryptographOpenSSL::checkSettingSslContext(QSharedPointer<QSslContext> tlsContext)
{
- if (sslContextPointer.isNull())
- sslContextPointer = tlsContext;
+ if (!sslContextPointer)
+ sslContextPointer = std::move(tlsContext);
}
QSharedPointer<QSslContext> TlsCryptographOpenSSL::sslContext() const
@@ -815,7 +815,7 @@ void TlsCryptographOpenSSL::continueHandshake()
// Cache this SSL session inside the QSslContext
if (!(configuration.testSslOption(QSsl::SslOptionDisableSessionSharing))) {
if (!sslContextPointer->cacheSession(ssl)) {
- sslContextPointer.clear(); // we could not cache the session
+ sslContextPointer.reset(); // we could not cache the session
} else {
// Cache the session for permanent usage as well
if (!(configuration.testSslOption(QSsl::SslOptionDisableSessionPersistence))) {
@@ -1367,7 +1367,7 @@ bool TlsCryptographOpenSSL::initSslContext()
if (sslContextPointer->error() != QSslError::NoError) {
setErrorAndEmit(d, QAbstractSocket::SslInvalidUserDataError, sslContextPointer->errorString());
- sslContextPointer.clear(); // deletes the QSslContext
+ sslContextPointer.reset();
return false;
}
@@ -1495,7 +1495,7 @@ void TlsCryptographOpenSSL::destroySslContext()
q_SSL_free(ssl);
ssl = nullptr;
}
- sslContextPointer.clear();
+ sslContextPointer.reset();
}
void TlsCryptographOpenSSL::storePeerCertificates()