summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorPeter Hartmann <phartmann@blackberry.com>2013-07-22 17:41:47 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-31 10:32:10 +0200
commitceedbadb516a5b5d86d4ec2802388c802e4d9a19 (patch)
tree245568355b06b688c773c1fc6926b9fffeda85db /src/network
parent587d832f715771b80e31f35372efc60f09316d55 (diff)
QNX: adapt SSL lib file name lookup heuristics
I.e. do not try to load file names that are not there anyhow. The code would search for libcrypto.so.1.0.0 and libssl.so.1.0.0, while on QNX the libs are called libcrypto.so and libssl.so, and there are no symlinks with version numbers. This saves ~ 45 ms in real apps (tested with Facebook, Twitter and Foursquare), and ~ 24 ms at app startup in an isolated app without GUI (difference maybe because threads are fighting for CPU or so). Task-number: QTBUG-32548 (backport of commit 69b31f7b657a7ca611ad980c2974597de160598c) Change-Id: I33e1c9e2c490b9c7f94aca06add8dc183cce083d Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index ec8c452060..49b6a7642e 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -502,7 +502,10 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
#ifdef Q_OS_OPENBSD
libcrypto->setLoadHints(QLibrary::ExportExternalSymbolsHint);
#endif
-#ifdef SHLIB_VERSION_NUMBER
+#if defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so
+ libssl->setLoadHints(QLibrary::ImprovedSearchHeuristics);
+ libcrypto->setLoadHints(libcrypto->loadHints() | QLibrary::ImprovedSearchHeuristics);
+#elif defined(SHLIB_VERSION_NUMBER)
// first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER));
libssl->setLoadHints(QLibrary::ImprovedSearchHeuristics);