summaryrefslogtreecommitdiffstats
path: root/src/network/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/kernel')
-rw-r--r--src/network/kernel/qauthenticator.cpp1
-rw-r--r--src/network/kernel/qauthenticator.h4
-rw-r--r--src/network/kernel/qdnslookup.h4
-rw-r--r--src/network/kernel/qhostaddress.h3
-rw-r--r--src/network/kernel/qhostinfo.cpp4
-rw-r--r--src/network/kernel/qhostinfo.h4
-rw-r--r--src/network/kernel/qnetworkfunctions_wince.h4
-rw-r--r--src/network/kernel/qnetworkinterface.h4
-rw-r--r--src/network/kernel/qnetworkproxy.cpp2
-rw-r--r--src/network/kernel/qnetworkproxy.h4
-rw-r--r--src/network/kernel/qnetworkproxy_blackberry.cpp30
-rw-r--r--src/network/kernel/qnetworkproxy_mac.cpp5
-rw-r--r--src/network/kernel/qurlinfo_p.h4
13 files changed, 31 insertions, 42 deletions
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..d9d8396011 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -699,8 +699,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/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/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