diff options
Diffstat (limited to 'src/network/kernel')
-rw-r--r-- | src/network/kernel/kernel.pri | 8 | ||||
-rw-r--r-- | src/network/kernel/qauthenticator.cpp | 1 | ||||
-rw-r--r-- | src/network/kernel/qauthenticator.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qdnslookup.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qhostaddress.h | 3 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 13 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qhostinfo_unix.cpp | 2 | ||||
-rw-r--r-- | src/network/kernel/qnetworkfunctions_wince.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qnetworkinterface_unix.cpp | 2 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy.cpp | 2 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy.h | 4 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy_blackberry.cpp | 30 | ||||
-rw-r--r-- | src/network/kernel/qnetworkproxy_mac.cpp | 5 | ||||
-rw-r--r-- | src/network/kernel/qurlinfo_p.h | 4 |
16 files changed, 47 insertions, 47 deletions
diff --git a/src/network/kernel/kernel.pri b/src/network/kernel/kernel.pri index 57df8c8bc8..a4a19988b3 100644 --- a/src/network/kernel/kernel.pri +++ b/src/network/kernel/kernel.pri @@ -27,7 +27,7 @@ SOURCES += kernel/qauthenticator.cpp \ unix:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp -linux-android* { +android { SOURCES -= kernel/qdnslookup_unix.cpp SOURCES += kernel/qdnslookup_android.cpp } @@ -39,7 +39,11 @@ win32: { } integrity:SOURCES += kernel/qdnslookup_unix.cpp kernel/qhostinfo_unix.cpp kernel/qnetworkinterface_unix.cpp -mac:LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation -framework CoreServices +mac { + LIBS_PRIVATE += -framework SystemConfiguration -framework CoreFoundation + !ios: LIBS_PRIVATE += -framework CoreServices +} + mac:!ios:SOURCES += kernel/qnetworkproxy_mac.cpp else:win32:SOURCES += kernel/qnetworkproxy_win.cpp else:blackberry:SOURCES += kernel/qnetworkproxy_blackberry.cpp diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp index e337a39415..73991aba96 100644 --- a/src/network/kernel/qauthenticator.cpp +++ b/src/network/kernel/qauthenticator.cpp @@ -852,7 +852,6 @@ QByteArray QAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge, //************************Global variables*************************** const int blockSize = 64; //As per RFC2104 Block-size is 512 bits -const int nDigestLen = 16; //Trunctaion Length of the Hmac-Md5 digest const quint8 respversion = 1; const quint8 hirespversion = 1; diff --git a/src/network/kernel/qauthenticator.h b/src/network/kernel/qauthenticator.h index 7d199d1dce..b784cd7f50 100644 --- a/src/network/kernel/qauthenticator.h +++ b/src/network/kernel/qauthenticator.h @@ -45,8 +45,6 @@ #include <QtCore/qstring.h> #include <QtCore/qvariant.h> -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -86,6 +84,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/network/kernel/qdnslookup.h b/src/network/kernel/qdnslookup.h index 5218c2618a..1df21d866e 100644 --- a/src/network/kernel/qdnslookup.h +++ b/src/network/kernel/qdnslookup.h @@ -48,8 +48,6 @@ #include <QtCore/qsharedpointer.h> #include <QtCore/qstring.h> -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QHostAddress; @@ -248,6 +246,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QDNSLOOKUP_H diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h index 0e50a677ed..77a2ec4105 100644 --- a/src/network/kernel/qhostaddress.h +++ b/src/network/kernel/qhostaddress.h @@ -49,8 +49,6 @@ struct sockaddr; -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -142,5 +140,4 @@ Q_NETWORK_EXPORT QDataStream &operator>>(QDataStream &, QHostAddress &); QT_END_NAMESPACE -QT_END_HEADER #endif // QHOSTADDRESS_H diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 6de83c3754..d25372ece6 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -164,6 +164,9 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, int id = theIdCounter.fetchAndAddRelaxed(1); // generate unique ID if (name.isEmpty()) { + if (!receiver) + return -1; + QHostInfo hostInfo(id); hostInfo.setError(QHostInfo::HostNotFound); hostInfo.setErrorString(QCoreApplication::translate("QHostInfo", "No host name given")); @@ -183,6 +186,9 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, bool valid = false; QHostInfo info = manager->cache.get(name, &valid); if (valid) { + if (!receiver) + return -1; + info.setLookupId(id); QHostInfoResult result; QObject::connect(&result, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); @@ -193,7 +199,8 @@ int QHostInfo::lookupHost(const QString &name, QObject *receiver, // cache is not enabled or it was not in the cache, do normal lookup QHostInfoRunnable* runnable = new QHostInfoRunnable(name, id); - QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); + if (receiver) + QObject::connect(&runnable->resultEmitter, SIGNAL(resultsReady(QHostInfo)), receiver, member, Qt::QueuedConnection); manager->scheduleLookup(runnable); } return id; @@ -699,8 +706,8 @@ void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e) } // cache for 60 seconds -// cache 64 items -QHostInfoCache::QHostInfoCache() : max_age(60), enabled(true), cache(64) +// cache 128 items +QHostInfoCache::QHostInfoCache() : max_age(60), enabled(true), cache(128) { #ifdef QT_QHOSTINFO_CACHE_DISABLED_BY_DEFAULT enabled = false; diff --git a/src/network/kernel/qhostinfo.h b/src/network/kernel/qhostinfo.h index 89cc5ba26b..38d55def34 100644 --- a/src/network/kernel/qhostinfo.h +++ b/src/network/kernel/qhostinfo.h @@ -46,8 +46,6 @@ #include <QtCore/qscopedpointer.h> #include <QtNetwork/qhostaddress.h> -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -98,6 +96,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QHostInfo) -QT_END_HEADER - #endif // QHOSTINFO_H diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp index 0e147c4877..fac83b922b 100644 --- a/src/network/kernel/qhostinfo_unix.cpp +++ b/src/network/kernel/qhostinfo_unix.cpp @@ -323,7 +323,7 @@ QString QHostInfo::localHostName() QString QHostInfo::localDomainName() { -#if !defined(Q_OS_VXWORKS) && !defined(Q_OS_LINUX_ANDROID) +#if !defined(Q_OS_VXWORKS) && !defined(Q_OS_ANDROID) resolveLibrary(); if (local_res_ninit) { // using thread-safe version diff --git a/src/network/kernel/qnetworkfunctions_wince.h b/src/network/kernel/qnetworkfunctions_wince.h index 858600bcca..ccf1ed9e38 100644 --- a/src/network/kernel/qnetworkfunctions_wince.h +++ b/src/network/kernel/qnetworkfunctions_wince.h @@ -50,8 +50,6 @@ #include <qt_windows.h> -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE DECLARE_HANDLE(SC_HANDLE); @@ -96,7 +94,5 @@ typedef LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS; QT_END_NAMESPACE -QT_END_HEADER - #endif // Q_OS_WINCE #endif // QNETWORKFUNCTIONS_WINCE_H diff --git a/src/network/kernel/qnetworkinterface.h b/src/network/kernel/qnetworkinterface.h index 9ecc371b54..f288b8d938 100644 --- a/src/network/kernel/qnetworkinterface.h +++ b/src/network/kernel/qnetworkinterface.h @@ -48,8 +48,6 @@ #ifndef QT_NO_NETWORKINTERFACE -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -137,8 +135,6 @@ Q_NETWORK_EXPORT QDebug operator<<(QDebug debug, const QNetworkInterface &networ QT_END_NAMESPACE -QT_END_HEADER - #endif // QT_NO_NETWORKINTERFACE #endif diff --git a/src/network/kernel/qnetworkinterface_unix.cpp b/src/network/kernel/qnetworkinterface_unix.cpp index 46eeb46f98..7885d122ea 100644 --- a/src/network/kernel/qnetworkinterface_unix.cpp +++ b/src/network/kernel/qnetworkinterface_unix.cpp @@ -61,7 +61,7 @@ # define QT_NO_GETIFADDRS #endif -#ifdef Q_OS_LINUX_ANDROID +#ifdef Q_OS_ANDROID // android lacks if_nameindex # define QT_NO_IPV6IFNAME #endif diff --git a/src/network/kernel/qnetworkproxy.cpp b/src/network/kernel/qnetworkproxy.cpp index 242855eaba..931c52eab0 100644 --- a/src/network/kernel/qnetworkproxy.cpp +++ b/src/network/kernel/qnetworkproxy.cpp @@ -1562,7 +1562,7 @@ void QNetworkProxyFactory::setApplicationProxyFactory(QNetworkProxyFactory *fact \li On Windows platforms, this function may take several seconds to execute depending on the configuration of the user's system. - \li On BlackBerry, only UrlRequest queries are supported. SOCKS is + \li On BlackBerry, only UrlRequest and TcpSocket queries are supported. SOCKS is not supported. The proxy credentials are only retrieved for the default configuration. \endlist diff --git a/src/network/kernel/qnetworkproxy.h b/src/network/kernel/qnetworkproxy.h index 081a993e33..153c84028a 100644 --- a/src/network/kernel/qnetworkproxy.h +++ b/src/network/kernel/qnetworkproxy.h @@ -48,8 +48,6 @@ #ifndef QT_NO_NETWORKPROXY -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -220,8 +218,6 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QNetworkProxy) -QT_END_HEADER - #endif // QT_NO_NETWORKPROXY #endif // QHOSTINFO_H diff --git a/src/network/kernel/qnetworkproxy_blackberry.cpp b/src/network/kernel/qnetworkproxy_blackberry.cpp index 2743b90404..c0f5c43a78 100644 --- a/src/network/kernel/qnetworkproxy_blackberry.cpp +++ b/src/network/kernel/qnetworkproxy_blackberry.cpp @@ -63,14 +63,36 @@ QT_BEGIN_NAMESPACE QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkProxyQuery &query) { - QNetworkProxy proxy; + if (query.url().scheme() == QLatin1String("file") + || query.url().scheme() == QLatin1String("qrc")) + return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy); - if (query.queryType() != QNetworkProxyQuery::UrlRequest) { + if (query.queryType() != QNetworkProxyQuery::UrlRequest + && query.queryType() != QNetworkProxyQuery::TcpSocket) { qWarning("Unsupported query type: %d", query.queryType()); return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy); } - QUrl url = query.url(); + QUrl url; + if (query.queryType() == QNetworkProxyQuery::UrlRequest) { + url = query.url(); + } else if (query.queryType() == QNetworkProxyQuery::TcpSocket + && !query.peerHostName().isEmpty()) { + url.setHost(query.peerHostName()); + switch (query.peerPort()) { + case 443: + url.setScheme(QStringLiteral("https")); + break; + case 21: + url.setScheme(QStringLiteral("ftp")); + break; + default: + // for unknown ports, we just pretend we are dealing + // with a HTTP URL, otherwise we will not get a proxy + // from the netstatus API + url.setScheme(QStringLiteral("http")); + } + } if (!url.isValid()) { qWarning("Invalid URL: %s", qPrintable(url.toString())); @@ -112,6 +134,8 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro return QList<QNetworkProxy>() << QNetworkProxy(QNetworkProxy::NoProxy); } + QNetworkProxy proxy; + QString protocol = query.protocolTag(); if (protocol.startsWith(QLatin1String("http"), Qt::CaseInsensitive)) { // http, https proxy.setType((QNetworkProxy::HttpProxy)); diff --git a/src/network/kernel/qnetworkproxy_mac.cpp b/src/network/kernel/qnetworkproxy_mac.cpp index a283b7ee05..4a4acb59d4 100644 --- a/src/network/kernel/qnetworkproxy_mac.cpp +++ b/src/network/kernel/qnetworkproxy_mac.cpp @@ -231,7 +231,6 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query) // PAC is enabled CFStringRef cfPacLocation = (CFStringRef)CFDictionaryGetValue(dict, kSCPropNetProxiesProxyAutoConfigURLString); -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { QCFType<CFDataRef> pacData; QCFType<CFURLRef> pacUrl = CFURLCreateWithString(kCFAllocatorDefault, cfPacLocation, NULL); @@ -275,9 +274,7 @@ QList<QNetworkProxy> macQueryInternal(const QNetworkProxyQuery &query) result << proxyFromDictionary(proxy); } return result; - } else -#endif - { + } else { QString pacLocation = QCFString::toQString(cfPacLocation); qWarning("Mac system proxy: PAC script at \"%s\" not handled", qPrintable(pacLocation)); } diff --git a/src/network/kernel/qurlinfo_p.h b/src/network/kernel/qurlinfo_p.h index 955a2eb325..1aa59f25ad 100644 --- a/src/network/kernel/qurlinfo_p.h +++ b/src/network/kernel/qurlinfo_p.h @@ -46,8 +46,6 @@ #include <QtCore/qstring.h> #include <QtCore/qiodevice.h> -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -125,6 +123,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QURLINFO_H |