diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 16 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols_p.h | 33 |
3 files changed, 31 insertions, 20 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index b6a3b5e3ab..ba9e5cbdc4 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -560,7 +560,7 @@ QHttpNetworkReply* QHttpNetworkConnectionPrivate::queueRequest(const QHttpNetwor // untill we have started the first connection attempt. So no // request will be started untill we know if IPv4 or IPv6 // should be used. - if (networkLayerState == Unknown) { + if (networkLayerState == Unknown || networkLayerState == InProgress) { startHostInfoLookup(); } else if ( networkLayerState == IPv4 || networkLayerState == IPv6 ) { // this used to be called via invokeMethod and a QueuedConnection diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index a010075436..ddf53f18f4 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -114,6 +114,18 @@ QT_BEGIN_NAMESPACE possibly with a different version of OpenSSL. */ +namespace { +void qsslSocketUnresolvedSymbolWarning(const char *functionName) +{ + qWarning("QSslSocket: cannot call unresolved function %s", functionName); +} + +void qsslSocketCannotResolveSymbolWarning(const char *functionName) +{ + qWarning("QSslSocket: cannot resolve %s", functionName); +} +} + #ifdef SSLEAY_MACROS DEFINEFUNC3(void *, ASN1_dup, i2d_of_void *a, a, d2i_of_void *b, b, char *c, c, return 0, return) #endif @@ -338,7 +350,7 @@ DEFINEFUNC3(SSL_SESSION *, d2i_SSL_SESSION, SSL_SESSION **a, a, const unsigned c #define RESOLVEFUNC(func) \ if (!(_q_##func = _q_PTR_##func(libs.first->resolve(#func))) \ && !(_q_##func = _q_PTR_##func(libs.second->resolve(#func)))) \ - qWarning("QSslSocket: cannot resolve "#func); + qsslSocketCannotResolveSymbolWarning(#func); #if !defined QT_LINKED_OPENSSL @@ -516,8 +528,6 @@ static QPair<QSystemLibrary*, QSystemLibrary*> loadOpenSslWin32() static QPair<QLibrary*, QLibrary*> loadOpenSsl() { QPair<QLibrary*,QLibrary*> pair; - pair.first = 0; - pair.second = 0; # if defined(Q_OS_UNIX) QLibrary *&libssl = pair.first; diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h index 1fd98cc7fb..7e1a1c983c 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols_p.h +++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h @@ -69,6 +69,7 @@ // #include "qsslsocket_openssl_p.h" +#include <QtCore/qglobal.h> QT_BEGIN_NAMESPACE @@ -82,8 +83,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a); \ @@ -94,8 +95,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func);\ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func);\ err; \ } \ funcret _q_##func(a, b); \ @@ -106,8 +107,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2, arg3); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2, arg3) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a, b, c); \ @@ -118,8 +119,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2, arg3, arg4) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a, b, c, d); \ @@ -130,8 +131,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2, arg3, arg4, arg5) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a, b, c, d, e); \ @@ -142,8 +143,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a, b, c, d, e, f); \ @@ -154,8 +155,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \ - if (!_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a, b, c, d, e, f, g); \ @@ -166,8 +167,8 @@ QT_BEGIN_NAMESPACE typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \ static _q_PTR_##func _q_##func = 0; \ ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { \ - if (_q_##func) { \ - qWarning("QSslSocket: cannot call unresolved function "#func); \ + if (Q_UNLIKELY(!_q_##func)) { \ + qsslSocketUnresolvedSymbolWarning(#func); \ err; \ } \ funcret _q_##func(a, b, c, d, e, f, g, h, i); \ |