summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_openssl_symbols.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-09-07 11:30:11 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-09-07 11:30:11 (GMT)
commit2b6dd2c7b44e37e79b1ae929a761c17929a2e569 (patch)
tree30f3c55312be601d29c0acbc318db75d7d06b188 /src/network/ssl/qsslsocket_openssl_symbols.cpp
parent98a4db7321cb286cd0a7a07adeb265798a650515 (diff)
parent2735bc6759f881c786a1097580a8682e3d28f365 (diff)
downloadQt-2b6dd2c7b44e37e79b1ae929a761c17929a2e569.zip
Qt-2b6dd2c7b44e37e79b1ae929a761c17929a2e569.tar.gz
Qt-2b6dd2c7b44e37e79b1ae929a761c17929a2e569.tar.bz2
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: qmake/Makefile.win32 src/corelib/io/qfsfileengine_win.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/gui/dialogs/qfiledialog_win.cpp src/gui/inputmethod/qcoefepinputcontext_s60.cpp src/gui/text/qfontdatabase_win.cpp src/gui/util/qsystemtrayicon_win.cpp src/script/utils/qscriptdate.cpp tests/auto/qinputcontext/tst_qinputcontext.cpp tests/auto/qscriptengine/tst_qscriptengine.cpp
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl_symbols.cpp')
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index d1225c1..6affa36 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -42,7 +42,11 @@
#include "qsslsocket_openssl_symbols_p.h"
-#include <QtCore/qlibrary.h>
+#ifdef Q_OS_WIN
+# include <private/qsystemlibrary_p.h>
+#else
+# include <QtCore/qlibrary.h>
+#endif
#include <QtCore/qmutex.h>
#include <private/qmutexpool_p.h>
#include <QtCore/qdatetime.h>
@@ -345,22 +349,22 @@ static QStringList findAllLibSsl()
}
# endif
-static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+#ifdef Q_OS_WIN
+static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32()
{
- QPair<QLibrary*,QLibrary*> pair;
+ QPair<QSystemLibrary*,QSystemLibrary*> pair;
pair.first = 0;
pair.second = 0;
-# ifdef Q_OS_WIN
- QLibrary *ssleay32 = new QLibrary(QLatin1String("ssleay32"));
- if (!ssleay32->load()) {
+ QSystemLibrary *ssleay32 = new QSystemLibrary(QLatin1String("ssleay32"));
+ if (!ssleay32->load(false)) {
// Cannot find ssleay32.dll
delete ssleay32;
return pair;
}
- QLibrary *libeay32 = new QLibrary(QLatin1String("libeay32"));
- if (!libeay32->load()) {
+ QSystemLibrary *libeay32 = new QSystemLibrary(QLatin1String("libeay32"));
+ if (!libeay32->load(false)) {
delete ssleay32;
delete libeay32;
return pair;
@@ -369,7 +373,16 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
pair.first = ssleay32;
pair.second = libeay32;
return pair;
-# elif defined(Q_OS_SYMBIAN)
+}
+#else
+
+static QPair<QLibrary*, QLibrary*> loadOpenSsl()
+{
+ QPair<QLibrary*,QLibrary*> pair;
+ pair.first = 0;
+ pair.second = 0;
+
+# if defined(Q_OS_SYMBIAN)
QLibrary *libssl = new QLibrary(QLatin1String("libssl"));
if (!libssl->load()) {
// Cannot find ssleay32.dll
@@ -469,6 +482,7 @@ static QPair<QLibrary*, QLibrary*> loadOpenSsl()
return pair;
# endif
}
+#endif
bool q_resolveOpenSslSymbols()
{
@@ -483,7 +497,11 @@ bool q_resolveOpenSslSymbols()
return false;
triedToResolveSymbols = true;
+#ifdef Q_OS_WIN
+ QPair<QSystemLibrary *, QSystemLibrary *> libs = loadOpenSslWin32();
+#else
QPair<QLibrary *, QLibrary *> libs = loadOpenSsl();
+#endif
if (!libs.first || !libs.second)
// failed to load them
return false;