From 7ca90e985cd92c9537fec6d523b93b45c5edfdb5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 17 Jan 2016 14:16:43 +0100 Subject: QSslSocket (OpenSSL): replace QList by QVector A QList> is one of the most dangerous ones, because it fundamentally changes memory layout, and therefore performance and invariants, when going from 32-bit platforms (array list) to 64-bit (vector-like). Port to QVector instead, which has a consistent design across all platforms. Also port from QPair to a simple struct { code, depth }, because member names such as 'first' and 'second' have no semantic value and make code using them very hard to understand. Change-Id: I86c95d78dbb2e82ec222d6eae8ba11568e3ff0af Reviewed-by: Lars Knoll --- src/network/ssl/qsslsocket_openssl_p.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/network/ssl/qsslsocket_openssl_p.h') diff --git a/src/network/ssl/qsslsocket_openssl_p.h b/src/network/ssl/qsslsocket_openssl_p.h index 890576e378..dc60adda39 100644 --- a/src/network/ssl/qsslsocket_openssl_p.h +++ b/src/network/ssl/qsslsocket_openssl_p.h @@ -103,6 +103,14 @@ typedef _STACK STACK; QT_BEGIN_NAMESPACE +struct QSslErrorEntry { + int code; + int depth; + + static QSslErrorEntry fromStoreContext(X509_STORE_CTX *ctx); +}; +Q_DECLARE_TYPEINFO(QSslErrorEntry, Q_PRIMITIVE_TYPE); + class QSslSocketBackendPrivate : public QSslSocketPrivate { Q_DECLARE_PUBLIC(QSslSocket) @@ -117,7 +125,7 @@ public: BIO *readBio; BIO *writeBio; SSL_SESSION *session; - QList > errorList; + QVector errorList; #if OPENSSL_VERSION_NUMBER >= 0x10001000L static int s_indexForSSLExtraData; // index used in SSL_get_ex_data to get the matching QSslSocketBackendPrivate #endif -- cgit v1.2.3